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