Class: OrangeData::ReceiptContent::CheckClose
- Inherits:
-
PayloadContent
- Object
- PayloadContent
- OrangeData::ReceiptContent::CheckClose
- Defined in:
- lib/orange_data/receipt.rb
Instance Attribute Summary collapse
-
#payments ⇒ Object
readonly
Returns the value of attribute payments.
Instance Method Summary collapse
-
#initialize(payload = {}) ⇒ CheckClose
constructor
A new instance of CheckClose.
- #to_hash ⇒ Object
Methods inherited from PayloadContent
#==, #assign_attributes, #attributes, #to_json
Constructor Details
#initialize(payload = {}) ⇒ CheckClose
Returns a new instance of CheckClose.
142 143 144 145 146 |
# File 'lib/orange_data/receipt.rb', line 142 def initialize(payload={}) payload ||= {} @payload = payload @payments = (payload['payments'] || []).map{|p| Payment.new(p) } end |
Instance Attribute Details
#payments ⇒ Object (readonly)
Returns the value of attribute payments.
154 155 156 |
# File 'lib/orange_data/receipt.rb', line 154 def payments @payments end |
Instance Method Details
#to_hash ⇒ Object
148 149 150 151 152 |
# File 'lib/orange_data/receipt.rb', line 148 def to_hash @payload.dup.tap{|h| h["payments"] = @payments.map(&:to_hash) if @payments } end |