Exception: Shamu::NotFoundError
- Defined in:
- lib/shamu/error.rb
Overview
The resource was not found.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(message = :not_found, id: :not_set, resource: :not_set) ⇒ NotFoundError
constructor
A new instance of NotFoundError.
Constructor Details
#initialize(message = :not_found, id: :not_set, resource: :not_set) ⇒ NotFoundError
Returns a new instance of NotFoundError.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/shamu/error.rb', line 23 def initialize( = :not_found, id: :not_set, resource: :not_set ) @id = id @resource = resource if == :not_found = if id != :not_set if resource != :not_set :resource_not_found_with_id else :not_found_with_id end elsif resource != :not_set :resource_not_found else :not_found end end super translate( , id: id, resource: resource ) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
20 21 22 |
# File 'lib/shamu/error.rb', line 20 def id @id end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
21 22 23 |
# File 'lib/shamu/error.rb', line 21 def resource @resource end |