Class: ArrowPayments::Customer
- Defined in:
- lib/arrow_payments/customer.rb
Instance Method Summary collapse
- #PaymentMethods ⇒ Object
- #PaymentMethods=(data) ⇒ Object
- #RecurrentBillings=(data) ⇒ Object
- #to_source_hash(options = {}) ⇒ Object
Methods inherited from Entity
Instance Method Details
#PaymentMethods ⇒ Object
20 21 22 |
# File 'lib/arrow_payments/customer.rb', line 20 def PaymentMethods (payment_methods || []).map(&:to_source_hash) end |
#PaymentMethods=(data) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/arrow_payments/customer.rb', line 12 def PaymentMethods=(data) if data.kind_of?(Array) self.payment_methods = data.map { |d| PaymentMethod.new(d) } else self.payment_methods = [] end end |
#RecurrentBillings=(data) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/arrow_payments/customer.rb', line 24 def RecurrentBillings=(data) if data.kind_of?(Array) self.recurring_billings = data.map { |d| RecurringBilling.new(d) } else self.recurring_billings = [] end end |
#to_source_hash(options = {}) ⇒ Object
32 33 34 35 36 |
# File 'lib/arrow_payments/customer.rb', line 32 def to_source_hash(={}) hash = super() hash.merge!('PaymentMethods' => (payment_methods || []).map(&:to_source_hash)) hash end |