Class: Wirecard::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_response) ⇒ Response

Returns a new instance of Response.



5
6
7
# File 'lib/wirecard/response.rb', line 5

def initialize(http_response)
  @body = http_response.body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



3
4
5
# File 'lib/wirecard/response.rb', line 3

def body
  @body
end

Instance Method Details

#to_hashObject



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

def to_hash
  Hash[CGI.parse(body).map{ |param| extract_key_value(param) }]
end