Exception: Exceptions::Resource
- Defined in:
- lib/exceptions/resource.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#error ⇒ String
for standard errors this method build a hash.
-
#message ⇒ String
return the error message.
-
#status ⇒ Object
return the error status.
Methods inherited from Base
build, #initialize, #model?, #simple?
Constructor Details
This class inherits a constructor from Exceptions::Base
Instance Method Details
#error ⇒ String
for standard errors this method build a hash
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/exceptions/resource.rb', line 4 def error { error: { model: self.object["model"], attribute: self.object["attribute"], field: self.object["field"], message: self.object["message"], full_message: "#{self.object["attribute"]} #{self.object["message"]}" } } end |
#message ⇒ String
return the error message
18 19 20 |
# File 'lib/exceptions/resource.rb', line 18 def self.error[:message] end |
#status ⇒ Object
return the error status
23 24 25 |
# File 'lib/exceptions/resource.rb', line 23 def status 406 end |