Class: Iugu::PaymentMethod

Inherits:
APIResource show all
Includes:
APICreate, APIDelete, APIFetch, APISave
Defined in:
lib/iugu/payment_method.rb

Instance Attribute Summary

Attributes inherited from Object

#errors

Class Method Summary collapse

Methods included from APIDelete

#delete

Methods included from APISave

#save

Methods included from APICreate

included

Methods included from APIFetch

included, #refresh

Methods inherited from APIResource

#is_new?

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

Class Method Details

.url(options = {}) ⇒ Object

Raises:

  • (StandardError)


8
9
10
11
12
13
# File 'lib/iugu/payment_method.rb', line 8

def self.url(options = {}) 
  customer_id = options[:customer_id] || options["customer_id"]
  id = options[:id] || options["id"]
  raise StandardError, "Missing Customer ID" unless customer_id
  "#{Customer.url customer_id}/#{self.object_base_uri}" + self.relative_url(id)
end