Class: Iugu::Customer
- Inherits:
-
APIResource
- Object
- Object
- APIResource
- Iugu::Customer
- Defined in:
- lib/iugu/customer.rb
Instance Attribute Summary
Attributes inherited from Object
Instance Method Summary collapse
Methods included from APIDelete
Methods included from APISave
Methods included from APICreate
Methods included from APIFetch
Methods inherited from APIResource
Methods inherited from Object
#add_accessor, #attributes, #copy, #initialize, #method_missing, #modified_attributes, #set_attributes
Constructor Details
This class inherits a constructor from Iugu::Object
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Iugu::Object
Instance Method Details
#default_payment_method ⇒ Object
16 17 18 19 |
# File 'lib/iugu/customer.rb', line 16 def default_payment_method return false unless @attributes['default_payment_method_id'] PaymentMethod.fetch({ id: @attributes['default_payment_method_id'], customer_id: self.id }) end |
#invoices ⇒ Object
12 13 14 |
# File 'lib/iugu/customer.rb', line 12 def invoices APIChildResource.new({ customer_id: self.id }, Iugu::Invoice) end |
#payment_methods ⇒ Object
8 9 10 |
# File 'lib/iugu/customer.rb', line 8 def payment_methods APIChildResource.new({ customer_id: self.id }, Iugu::PaymentMethod) end |