Exception: OccamsRecord::NotFound
- Inherits:
-
StandardError
- Object
- StandardError
- OccamsRecord::NotFound
- Defined in:
- lib/occams-record/errors.rb
Overview
Exception when a requested record couldn’t be found.
Instance Attribute Summary collapse
- #attrs ⇒ Hash readonly
- #model_name ⇒ String readonly
Instance Method Summary collapse
-
#initialize(model_name, attrs) ⇒ NotFound
constructor
A new instance of NotFound.
- #message ⇒ String
- #to_s ⇒ String
Constructor Details
#initialize(model_name, attrs) ⇒ NotFound
65 66 67 |
# File 'lib/occams-record/errors.rb', line 65 def initialize(model_name, attrs) @model_name, @attrs = model_name, attrs end |
Instance Attribute Details
#attrs ⇒ Hash (readonly)
60 61 62 |
# File 'lib/occams-record/errors.rb', line 60 def attrs @attrs end |
#model_name ⇒ String (readonly)
58 59 60 |
# File 'lib/occams-record/errors.rb', line 58 def model_name @model_name end |
Instance Method Details
#message ⇒ String
75 76 77 |
# File 'lib/occams-record/errors.rb', line 75 def "#{model_name} could not be found with #{attrs}!" end |
#to_s ⇒ String
70 71 72 |
# File 'lib/occams-record/errors.rb', line 70 def to_s end |