Class: Portmone::Responses::BaseResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/portmone/responses/base_response.rb

Direct Known Subclasses

GenerateURL, OrderStatus

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(faraday_response, currency:, timezone:) ⇒ BaseResponse

Returns a new instance of BaseResponse.



5
6
7
8
9
10
# File 'lib/portmone/responses/base_response.rb', line 5

def initialize(faraday_response, currency:, timezone:)
  @response = faraday_response
  @xml_data = MultiXml.parse(@response.body)
  @currency = currency
  @timezone = timezone
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



2
3
4
# File 'lib/portmone/responses/base_response.rb', line 2

def response
  @response
end

#xml_dataObject (readonly)

Returns the value of attribute xml_data.



3
4
5
# File 'lib/portmone/responses/base_response.rb', line 3

def xml_data
  @xml_data
end

Instance Method Details

#http_statusObject



12
13
14
# File 'lib/portmone/responses/base_response.rb', line 12

def http_status
  response.status
end