Class: OrangeData::ReceiptContent::CheckClose

Inherits:
PayloadContent show all
Defined in:
lib/orange_data/receipt.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from PayloadContent

#==, #as_json, #assign_attributes, #attributes, #to_json

Constructor Details

#initialize(payload = {}) ⇒ CheckClose

Returns a new instance of CheckClose.



162
163
164
165
# File 'lib/orange_data/receipt.rb', line 162

def initialize(payload={})
  super(payload || {})
  @payments = (@payload['payments'] || []).map{|p| Payment.new(p) }
end

Instance Attribute Details

#paymentsObject (readonly)

Returns the value of attribute payments.



173
174
175
# File 'lib/orange_data/receipt.rb', line 173

def payments
  @payments
end

Instance Method Details

#to_hashObject



167
168
169
170
171
# File 'lib/orange_data/receipt.rb', line 167

def to_hash
  @payload.dup.tap{|h|
    h["payments"] = @payments.map(&:to_hash) if @payments
  }
end