Exception: SmartParams::MissingPropertyException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/smart_params/missing_property_exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:, last:) ⇒ MissingPropertyException

Returns a new instance of MissingPropertyException.



8
9
10
11
12
# File 'lib/smart_params/missing_property_exception.rb', line 8

def initialize(path:, last:)
  @path = path
  @last = last
  super(message)
end

Instance Attribute Details

#lastObject

Returns the value of attribute last.



6
7
8
# File 'lib/smart_params/missing_property_exception.rb', line 6

def last
  @last
end

#pathObject

Returns the value of attribute path.



5
6
7
# File 'lib/smart_params/missing_property_exception.rb', line 5

def path
  @path
end

Instance Method Details

#messageObject



14
15
16
# File 'lib/smart_params/missing_property_exception.rb', line 14

def message
  "/#{@path.join('/')} is missing from the structure, last node was #{@last.inspect}"
end