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

#==, #assign_attributes, #to_json

Constructor Details

#initialize(payload = {}) ⇒ CheckClose

Returns a new instance of CheckClose.



138
139
140
141
142
# File 'lib/orange_data/receipt.rb', line 138

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

Instance Attribute Details

#paymentsObject (readonly)

Returns the value of attribute payments.



150
151
152
# File 'lib/orange_data/receipt.rb', line 150

def payments
  @payments
end

Instance Method Details

#to_hashObject



144
145
146
147
148
# File 'lib/orange_data/receipt.rb', line 144

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