Class: Ingenico::Direct::SDK::Domain::APIError

Inherits:
Ingenico::Direct::SDK::DataObject show all
Defined in:
lib/ingenico/direct/sdk/domain/api_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Direct::SDK::DataObject

new_from_hash

Instance Attribute Details

#categoryString

Returns the current value of category.

Returns:

  • (String)

    the current value of category



16
17
18
# File 'lib/ingenico/direct/sdk/domain/api_error.rb', line 16

def category
  @category
end

#codeString

Returns the current value of code.

Returns:

  • (String)

    the current value of code



16
17
18
# File 'lib/ingenico/direct/sdk/domain/api_error.rb', line 16

def code
  @code
end

#http_status_codeInteger

Returns the current value of http_status_code.

Returns:

  • (Integer)

    the current value of http_status_code



16
17
18
# File 'lib/ingenico/direct/sdk/domain/api_error.rb', line 16

def http_status_code
  @http_status_code
end

#idString

Returns the current value of id.

Returns:

  • (String)

    the current value of id



16
17
18
# File 'lib/ingenico/direct/sdk/domain/api_error.rb', line 16

def id
  @id
end

#messageString

Returns the current value of message.

Returns:

  • (String)

    the current value of message



16
17
18
# File 'lib/ingenico/direct/sdk/domain/api_error.rb', line 16

def message
  @message
end

#property_nameString

Returns the current value of property_name.

Returns:

  • (String)

    the current value of property_name



16
17
18
# File 'lib/ingenico/direct/sdk/domain/api_error.rb', line 16

def property_name
  @property_name
end

Instance Method Details

#from_hash(hash) ⇒ Object



36
37
38
39
40
41
42
43
44
# File 'lib/ingenico/direct/sdk/domain/api_error.rb', line 36

def from_hash(hash)
  super
  @category = hash['category'] if hash.key? 'category'
  @code = hash['code'] if hash.key? 'code'
  @http_status_code = hash['httpStatusCode'] if hash.key? 'httpStatusCode'
  @id = hash['id'] if hash.key? 'id'
  @message = hash['message'] if hash.key? 'message'
  @property_name = hash['propertyName'] if hash.key? 'propertyName'
end

#to_hHash

Returns:

  • (Hash)


25
26
27
28
29
30
31
32
33
34
# File 'lib/ingenico/direct/sdk/domain/api_error.rb', line 25

def to_h
  hash = super
  hash['category'] = @category unless @category.nil?
  hash['code'] = @code unless @code.nil?
  hash['httpStatusCode'] = @http_status_code unless @http_status_code.nil?
  hash['id'] = @id unless @id.nil?
  hash['message'] = @message unless @message.nil?
  hash['propertyName'] = @property_name unless @property_name.nil?
  hash
end