Class: Ingenico::Connect::SDK::Domain::Payout::FindPayoutsResponse

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/payout/find_payouts_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#limitObject

Integer



15
16
17
# File 'lib/ingenico/connect/sdk/domain/payout/find_payouts_response.rb', line 15

def limit
  @limit
end

#offsetObject

Integer



18
19
20
# File 'lib/ingenico/connect/sdk/domain/payout/find_payouts_response.rb', line 18

def offset
  @offset
end

#payoutsObject

Array of PayoutResult



21
22
23
# File 'lib/ingenico/connect/sdk/domain/payout/find_payouts_response.rb', line 21

def payouts
  @payouts
end

#total_countObject

Integer



24
25
26
# File 'lib/ingenico/connect/sdk/domain/payout/find_payouts_response.rb', line 24

def total_count
  @total_count
end

Instance Method Details

#from_hash(hash) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/ingenico/connect/sdk/domain/payout/find_payouts_response.rb', line 35

def from_hash(hash)
  super
  if hash.has_key?('limit')
    @limit = hash['limit']
  end
  if hash.has_key?('offset')
    @offset = hash['offset']
  end
  if hash.has_key?('payouts')
    if !(hash['payouts'].is_a? Array)
      raise TypeError, "value '%s' is not an Array" % [hash['payouts']]
    end
    @payouts = []
    hash['payouts'].each do |e|
      @payouts << Ingenico::Connect::SDK::Domain::Payout::PayoutResult.new_from_hash(e)
    end
  end
  if hash.has_key?('totalCount')
    @total_count = hash['totalCount']
  end
end

#to_hObject



26
27
28
29
30
31
32
33
# File 'lib/ingenico/connect/sdk/domain/payout/find_payouts_response.rb', line 26

def to_h
  hash = super
  add_to_hash(hash, 'limit', @limit)
  add_to_hash(hash, 'offset', @offset)
  add_to_hash(hash, 'payouts', @payouts)
  add_to_hash(hash, 'totalCount', @total_count)
  hash
end