Exception: SmartParams::Error::InvalidPropertyType
- Inherits:
-
SmartParams::Error
- Object
- StandardError
- SmartParams::Error
- SmartParams::Error::InvalidPropertyType
- Defined in:
- lib/smart_params/error/invalid_property_type.rb
Instance Attribute Summary collapse
-
#keychain ⇒ Object
readonly
Returns the value of attribute keychain.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#wanted ⇒ Object
readonly
Returns the value of attribute wanted.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(keychain:, wanted:, raw:) ⇒ InvalidPropertyType
constructor
A new instance of InvalidPropertyType.
- #message ⇒ Object
Constructor Details
#initialize(keychain:, wanted:, raw:) ⇒ InvalidPropertyType
8 9 10 11 12 |
# File 'lib/smart_params/error/invalid_property_type.rb', line 8 def initialize(keychain:, wanted:, raw:) @keychain = keychain @wanted = wanted @raw = raw end |
Instance Attribute Details
#keychain ⇒ Object (readonly)
Returns the value of attribute keychain.
4 5 6 |
# File 'lib/smart_params/error/invalid_property_type.rb', line 4 def keychain @keychain end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
6 7 8 |
# File 'lib/smart_params/error/invalid_property_type.rb', line 6 def raw @raw end |
#wanted ⇒ Object (readonly)
Returns the value of attribute wanted.
5 6 7 |
# File 'lib/smart_params/error/invalid_property_type.rb', line 5 def wanted @wanted end |
Instance Method Details
#as_json ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/smart_params/error/invalid_property_type.rb', line 18 def as_json { "keychain" => keychain, "wanted" => wanted.type.name, "raw" => raw } end |
#message ⇒ Object
14 15 16 |
# File 'lib/smart_params/error/invalid_property_type.rb', line 14 def "expected #{keychain.inspect} to be #{wanted.type.name}, but was #{raw.inspect}" end |