Exception: ApiRecipes::MissingRouteAttribute
- Inherits:
-
Exception
- Object
- Exception
- ApiRecipes::MissingRouteAttribute
- Defined in:
- lib/api_recipes/exceptions.rb
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#route ⇒ Object
readonly
Returns the value of attribute route.
Instance Method Summary collapse
-
#initialize(message = nil, resource = nil, route = nil, attribute = nil) ⇒ MissingRouteAttribute
constructor
A new instance of MissingRouteAttribute.
Constructor Details
#initialize(message = nil, resource = nil, route = nil, attribute = nil) ⇒ MissingRouteAttribute
Returns a new instance of MissingRouteAttribute.
20 21 22 23 24 25 26 27 28 |
# File 'lib/api_recipes/exceptions.rb', line 20 def initialize( = nil, resource = nil, route = nil, attribute = nil) @resource = resource; @route = route; @attribute = attribute if # Nothing to do elsif @route && @attribute = "route '#{@resource}.#{@route}' requires '#{@attribute}' attribute but this was not given" end super() end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
18 19 20 |
# File 'lib/api_recipes/exceptions.rb', line 18 def attribute @attribute end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
18 19 20 |
# File 'lib/api_recipes/exceptions.rb', line 18 def resource @resource end |
#route ⇒ Object (readonly)
Returns the value of attribute route.
18 19 20 |
# File 'lib/api_recipes/exceptions.rb', line 18 def route @route end |