Class: Securetrading::Response

Inherits:
BaseModel show all
Defined in:
lib/securetrading/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#ox_xml

Constructor Details

#initialize(httparty) ⇒ Response

Returns a new instance of Response.



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

def initialize(httparty)
  @httparty = httparty
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Securetrading::BaseModel

Instance Attribute Details

#httpartyObject (readonly)

Returns the value of attribute httparty.



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

def httparty
  @httparty
end

Instance Method Details

#dataObject



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

def data
  rows.map { |row| Record.new(row) }
end

#foundObject



13
14
15
# File 'lib/securetrading/response.rb', line 13

def found
  attributes_hash['found'].to_i
end