Class: Docdata::Order::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/docdata/order/response.rb

Overview

Base class for responses.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, response) ⇒ Response

Returns a new instance of Response.



11
12
13
14
# File 'lib/docdata/order/response.rb', line 11

def initialize(options, response)
  @options = options
  @response = response
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/docdata/order/response.rb', line 9

def options
  @options
end

#responseObject (readonly)

Returns the value of attribute response.



9
10
11
# File 'lib/docdata/order/response.rb', line 9

def response
  @response
end

Instance Method Details

#bodyObject



16
17
18
# File 'lib/docdata/order/response.rb', line 16

def body
  response.body
end

#error_codeObject



24
25
26
# File 'lib/docdata/order/response.rb', line 24

def error_code
  errors[:error].attributes["code"] if errors
end

#error_messageObject



20
21
22
# File 'lib/docdata/order/response.rb', line 20

def error_message
  errors[:error] if errors
end