class Seatbelt::Errors::TypeMissmatchError
Public: Will be raised if a model is assigned to a 'has_many' association and the models class isn't of required type.
Attributes
awaited[RW]
got[RW]
Public Class Methods
new(awaited, got)
click to toggle source
Public: Initialize a TypeMissmatchError
.
awaited - The awaited objects class name got - The actual assigned objects class name.
# File lib/seatbelt/errors/errors.rb, line 74 def initialize(awaited, got) @awaited = awaited @got = got end
Public Instance Methods
to_s()
click to toggle source
The exception message in an understandable form.
Returns the error message.
# File lib/seatbelt/errors/errors.rb, line 82 def to_s msg = "An instance of #{awaited} awaited but " msg += "get an instance of #{got}." return msg end