Class: Invoiced::Customer
Constant Summary
collapse
- OBJECT_NAME =
'customer'
Instance Attribute Summary
Attributes inherited from Object
#client
Instance Method Summary
collapse
#delete
#save
#create
#list
Methods inherited from Object
#[], #[]=, #add_accessors, #build_endpoint, #each, #endpoint, #endpoint_base, #initialize, #inspect, #keys, #metaclass, #method_missing, #refresh_from, #remove_accessors, #retrieve, #set_endpoint_base, #to_hash, #to_json, #to_s, #values
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Invoiced::Object
Instance Method Details
34
35
36
37
38
|
# File 'lib/invoiced/customer.rb', line 34
def balance
response = @client.request(:get, "#{self.endpoint()}/balance")
response[:body]
end
|
#consolidate_invoices(params = {}) ⇒ Object
68
69
70
71
72
73
74
|
# File 'lib/invoiced/customer.rb', line 68
def consolidate_invoices(params={})
response = @client.request(:post, "#{self.endpoint()}/consolidate_invoices", params)
invoice = Invoice.new(@client)
Util.convert_to_object(invoice, response[:body])
end
|
40
41
42
43
|
# File 'lib/invoiced/customer.rb', line 40
def contacts()
contact = Contact.new(@client)
contact.set_endpoint_base(self.endpoint())
end
|
#invoice(params = {}, opts = {}) ⇒ Object
60
61
62
63
64
65
66
|
# File 'lib/invoiced/customer.rb', line 60
def invoice(params={}, opts={})
response = @client.request(:post, "#{self.endpoint()}/invoices", params, opts)
invoice = Invoice.new(@client)
Util.convert_to_object(invoice, response[:body])
end
|
#line_items ⇒ Object
50
51
52
53
|
# File 'lib/invoiced/customer.rb', line 50
def line_items()
line = LineItem.new(@client)
line.set_endpoint_base(self.endpoint())
end
|
#list_notes ⇒ Object
55
56
57
58
|
# File 'lib/invoiced/customer.rb', line 55
def list_notes()
note = Note.new(@client)
note.set_endpoint_base(self.endpoint())
end
|
#payment_sources ⇒ Object
45
46
47
48
|
# File 'lib/invoiced/customer.rb', line 45
def payment_sources()
source = PaymentSource.new(@client)
source.set_endpoint_base(self.endpoint())
end
|
#send_statement(params = {}, opts = {}) ⇒ Object
10
11
12
13
14
15
16
|
# File 'lib/invoiced/customer.rb', line 10
def send_statement(params={}, opts={})
response = @client.request(:post, "#{self.endpoint()}/emails", params, opts)
email = Email.new(@client)
Util.build_objects(email, response[:body])
end
|
#send_statement_letter(params = {}, opts = {}) ⇒ Object
26
27
28
29
30
31
32
|
# File 'lib/invoiced/customer.rb', line 26
def send_statement_letter(params={}, opts={})
response = @client.request(:post, "#{self.endpoint()}/letters", params, opts)
letter = Letter.new(@client)
Util.build_objects(letter, response[:body])
end
|
#send_statement_sms(params = {}, opts = {}) ⇒ Object
18
19
20
21
22
23
24
|
# File 'lib/invoiced/customer.rb', line 18
def send_statement_sms(params={}, opts={})
response = @client.request(:post, "#{self.endpoint()}/text_messages", params, opts)
text_message = TextMessage.new(@client)
Util.build_objects(text_message, response[:body])
end
|