Class: SmashRuby::Errors::NotFoundError
- Inherits:
-
Object
- Object
- SmashRuby::Errors::NotFoundError
- Defined in:
- lib/smash_ruby/errors/not_found_error.rb
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
-
#initialize(model, request) ⇒ NotFoundError
constructor
A new instance of NotFoundError.
- #to_json ⇒ Object
Constructor Details
#initialize(model, request) ⇒ NotFoundError
Returns a new instance of NotFoundError.
8 9 10 11 |
# File 'lib/smash_ruby/errors/not_found_error.rb', line 8 def initialize(model, request) @model = model @request = request end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
6 7 8 |
# File 'lib/smash_ruby/errors/not_found_error.rb', line 6 def model @model end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
6 7 8 |
# File 'lib/smash_ruby/errors/not_found_error.rb', line 6 def request @request end |
Instance Method Details
#to_json ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/smash_ruby/errors/not_found_error.rb', line 13 def to_json { model: @model, status: 404, error: "Not found with request: #{@request}" }.to_json end |