Class: Iugu::Customer
- Inherits:
-
APIResource
- Object
- Object
- APIResource
- Iugu::Customer
- Defined in:
- lib/iugu/customer.rb
Instance Attribute Summary
Attributes inherited from Object
#attributes, #errors, #unsaved_attributes
Instance Method Summary collapse
Methods included from APIDelete
Methods included from APISave
Methods included from APICreate
Methods included from APIFetch
Methods inherited from APIResource
endpoint_url, #is_new?, object_base_uri, object_type, relative_url, url
Methods inherited from Object
#add_accessor, #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
18 19 20 21 22 |
# File 'lib/iugu/customer.rb', line 18 def default_payment_method return false unless @attributes["default_payment_method_id"] PaymentMethod.fetch({ id: @attributes["default_payment_method_id"], customer_id: id }) end |
#invoices ⇒ Object
14 15 16 |
# File 'lib/iugu/customer.rb', line 14 def invoices APIChildResource.new({ customer_id: id }, Iugu::Invoice) end |
#payment_methods ⇒ Object
10 11 12 |
# File 'lib/iugu/customer.rb', line 10 def payment_methods APIChildResource.new({ customer_id: id }, Iugu::PaymentMethod) end |