Class: Invoiced::PaymentPlan

Inherits:
Object
  • Object
show all
Includes:
Operations::Delete
Defined in:
lib/invoiced/payment_plan.rb

Instance Attribute Summary

Attributes inherited from Object

#client

Instance Method Summary collapse

Methods included from Operations::Delete

#delete

Methods inherited from Object

#[], #[]=, #add_accessors, #each, #endpoint, #endpoint_base, #inspect, #keys, #load, #metaclass, #method_missing, #refresh_from, #remove_accessors, #set_endpoint_base, #to_hash, #to_json, #to_s, #values

Constructor Details

#initialize(client, id = nil, values = {}) ⇒ PaymentPlan

Returns a new instance of PaymentPlan.



5
6
7
8
# File 'lib/invoiced/payment_plan.rb', line 5

def initialize(client, id=nil, values={})
	super
	@endpoint = '/payment_plan'
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Invoiced::Object

Instance Method Details

#cancelObject



22
23
24
# File 'lib/invoiced/payment_plan.rb', line 22

def cancel
    delete
end

#create(body = {}) ⇒ Object



10
11
12
13
14
# File 'lib/invoiced/payment_plan.rb', line 10

def create(body={})
    response = @client.request(:put, self.endpoint(), body)

    Util.convert_to_object(self, response[:body])
end

#retrieve(opts = {}) ⇒ Object



16
17
18
19
20
# File 'lib/invoiced/payment_plan.rb', line 16

def retrieve(opts={})
    response = @client.request(:get, self.endpoint(), opts)

    Util.convert_to_object(self, response[:body])
end