Exception: AdsCommon::Errors::TypeMismatchError
- Defined in:
- lib/ads_common/errors.rb
Overview
Raised if the type of the object provided does not match expected type.
Instance Attribute Summary collapse
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#field_name ⇒ Object
readonly
Returns the value of attribute field_name.
-
#provided ⇒ Object
readonly
Returns the value of attribute provided.
Instance Method Summary collapse
-
#initialize(expected, provided, field_name) ⇒ TypeMismatchError
constructor
A new instance of TypeMismatchError.
- #to_s ⇒ Object
Constructor Details
#initialize(expected, provided, field_name) ⇒ TypeMismatchError
Returns a new instance of TypeMismatchError.
76 77 78 |
# File 'lib/ads_common/errors.rb', line 76 def initialize(expected, provided, field_name) @expected, @provided, @field_name = expected, provided, field_name end |
Instance Attribute Details
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
75 76 77 |
# File 'lib/ads_common/errors.rb', line 75 def expected @expected end |
#field_name ⇒ Object (readonly)
Returns the value of attribute field_name.
75 76 77 |
# File 'lib/ads_common/errors.rb', line 75 def field_name @field_name end |
#provided ⇒ Object (readonly)
Returns the value of attribute provided.
75 76 77 |
# File 'lib/ads_common/errors.rb', line 75 def provided @provided end |
Instance Method Details
#to_s ⇒ Object
79 80 81 82 |
# File 'lib/ads_common/errors.rb', line 79 def to_s() return "%s: expected: '%s', provided: '%s' for field '%s'" % [super, @expected, @provided, @field_name] end |