class Exceptions::Resource

Public Instance Methods

error() click to toggle source

for standard errors this method build a hash @return [String] json string

# 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() click to toggle source

return the error message @return [String]

# File lib/exceptions/resource.rb, line 18
def message
        self.error[:message]
end
status() click to toggle source

return the error status

# File lib/exceptions/resource.rb, line 23
def status
        406
end