Class: Rafflesia::ApiErrorBody

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/annotations/api_error_body.rb

Constant Summary collapse

HASH_ATTRS =
{
  code: :code,
  details: :details,
  doc_url: :doc_url,
  message: :message,
  param: :param,
  type: :type
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ ApiErrorBody

Returns a new instance of ApiErrorBody.



25
26
27
28
29
30
31
32
33
34
# File 'lib/rafflesia/annotations/api_error_body.rb', line 25

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @code = hash[:code]
  @details = hash[:details] || {}
  @doc_url = hash[:doc_url]
  @message = hash[:message]
  @param = hash[:param]
  @type = hash[:type]
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



17
18
19
# File 'lib/rafflesia/annotations/api_error_body.rb', line 17

def code
  @code
end

#detailsObject

Returns the value of attribute details.



17
18
19
# File 'lib/rafflesia/annotations/api_error_body.rb', line 17

def details
  @details
end

#doc_urlObject

Returns the value of attribute doc_url.



17
18
19
# File 'lib/rafflesia/annotations/api_error_body.rb', line 17

def doc_url
  @doc_url
end

#messageObject

Returns the value of attribute message.



17
18
19
# File 'lib/rafflesia/annotations/api_error_body.rb', line 17

def message
  @message
end

#paramObject

Returns the value of attribute param.



17
18
19
# File 'lib/rafflesia/annotations/api_error_body.rb', line 17

def param
  @param
end

#typeObject

Returns the value of attribute type.



17
18
19
# File 'lib/rafflesia/annotations/api_error_body.rb', line 17

def type
  @type
end