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
Returns a new instance of NotFound.
53 54 55 |
# File 'lib/occams-record/errors.rb', line 53 def initialize(model_name, attrs) @model_name, @attrs = model_name, attrs end |
Instance Attribute Details
#attrs ⇒ Hash (readonly)
48 49 50 |
# File 'lib/occams-record/errors.rb', line 48 def attrs @attrs end |
#model_name ⇒ String (readonly)
46 47 48 |
# File 'lib/occams-record/errors.rb', line 46 def model_name @model_name end |
Instance Method Details
#message ⇒ String
63 64 65 |
# File 'lib/occams-record/errors.rb', line 63 def "#{model_name} could not be found with #{attrs}!" end |
#to_s ⇒ String
58 59 60 |
# File 'lib/occams-record/errors.rb', line 58 def to_s end |