Class: Ebayr::Response

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

Overview

A response to an Ebayr::Request.

Instance Method Summary collapse

Methods inherited from Record

#<=>, #[], #[]=, #has_key?

Constructor Details

#initialize(request, response) ⇒ Response

Returns a new instance of Response.



5
6
7
8
9
10
11
12
13
# File 'lib/ebayr/response.rb', line 5

def initialize(request, response)
  @request = request
  @command = @request.command if @request
  @response = response
  @body = response.body if @response
  hash = self.class.from_xml(@body) if @body
  response_data = hash["#{@command}Response"] if hash
  super(response_data) if response_data
end