Class: Qiwi::Request::GetBillList

Inherits:
Base
  • Object
show all
Defined in:
lib/qiwi/request.rb

Instance Method Summary collapse

Methods inherited from Base

attributes, #body, inherited, #method, #soap_body, #with_envelope

Constructor Details

#initialize(client, hash) ⇒ GetBillList

Returns a new instance of GetBillList.

Parameters:

  • params (Hash)


129
130
131
132
133
# File 'lib/qiwi/request.rb', line 129

def initialize(client, hash)
  super
  @dateFrom = hash[:date_from].strftime('%d.%m.%Y %H:%M:%S') if hash[:date_from]
  @dateTo = hash[:date_to].strftime('%d.%m.%Y %H:%M:%S') if hash[:date_to]
end

Instance Method Details

#result_from_xml(xml) ⇒ Object



135
136
137
138
139
140
141
# File 'lib/qiwi/request.rb', line 135

def result_from_xml(xml)
  el = xml.xpath("//getBillListResponse")
  OpenStruct.new({
    txns: el.at('txns').text,
    count: el.at('count').text.to_i
  })
end