class Avski::Common::Exceptions::UnknownFieldException

@class [UnknownFieldException]

Attributes

code[R]
data[R]
message[R]
status[R]

Public Class Methods

new(message, status = 400, code = 0, data = {}) click to toggle source
# File lib/avski/common/exceptions.rb, line 11
def initialize(message, status = 400, code = 0, data = {})
  @status = status
  @message = message
  @data = data
  @code = code
end

Public Instance Methods

to_hash() click to toggle source
# File lib/avski/common/exceptions.rb, line 25
def to_hash
  {status: @status, message: @message, code: @code, data: @data}
end
to_json() click to toggle source

Convert Exception contents to a Json string. All attributes must be Json serializable.

# File lib/avski/common/exceptions.rb, line 21
def to_json
  JSON.generate(to_hash)
end
to_response() click to toggle source
# File lib/avski/common/exceptions.rb, line 29
def to_response
  [@status, to_json]
end