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, #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
#payments ⇒ Object (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_hash ⇒ Object
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 |