Exception: SmartParams::InvalidPropertyTypeException
- Inherits:
-
StandardError
- Object
- StandardError
- SmartParams::InvalidPropertyTypeException
- Defined in:
- lib/smart_params/invalid_property_type_exception.rb
Instance Attribute Summary collapse
-
#grievance ⇒ Object
readonly
Returns the value of attribute grievance.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#wanted ⇒ Object
readonly
Returns the value of attribute wanted.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(path:, wanted:, raw:, grievance:) ⇒ InvalidPropertyTypeException
constructor
A new instance of InvalidPropertyTypeException.
- #message ⇒ Object
Constructor Details
#initialize(path:, wanted:, raw:, grievance:) ⇒ InvalidPropertyTypeException
Returns a new instance of InvalidPropertyTypeException.
11 12 13 14 15 16 17 18 |
# File 'lib/smart_params/invalid_property_type_exception.rb', line 11 def initialize(path:, wanted:, raw:, grievance:) @path = path @wanted = wanted @raw = raw @type = raw.inspect @grievance = grievance super() end |
Instance Attribute Details
#grievance ⇒ Object (readonly)
Returns the value of attribute grievance.
9 10 11 |
# File 'lib/smart_params/invalid_property_type_exception.rb', line 9 def grievance @grievance end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/smart_params/invalid_property_type_exception.rb', line 5 def path @path end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
7 8 9 |
# File 'lib/smart_params/invalid_property_type_exception.rb', line 7 def raw @raw end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/smart_params/invalid_property_type_exception.rb', line 8 def type @type end |
#wanted ⇒ Object (readonly)
Returns the value of attribute wanted.
6 7 8 |
# File 'lib/smart_params/invalid_property_type_exception.rb', line 6 def wanted @wanted end |
Instance Method Details
#as_json ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/smart_params/invalid_property_type_exception.rb', line 24 def as_json { "path" => path, "wanted" => wanted, "grievance" => grievance, "raw" => raw } end |
#message ⇒ Object
20 21 22 |
# File 'lib/smart_params/invalid_property_type_exception.rb', line 20 def "expected /#{path.join('/')} to be #{wanted.name}, but is #{type} and #{grievance}" end |