Class: Printavo::Invoice
Instance Method Summary
collapse
#==, #[], #dig, #initialize, #inspect, #to_h
Instance Method Details
#amount_outstanding ⇒ Object
13
|
# File 'lib/printavo/models/invoice.rb', line 13
def amount_outstanding = self['amountOutstanding']
|
#amount_paid ⇒ Object
12
|
# File 'lib/printavo/models/invoice.rb', line 12
def amount_paid = self['amountPaid']
|
40
41
42
43
|
# File 'lib/printavo/models/invoice.rb', line 40
def contact
attrs = self['contact']
Contact.new(attrs) if attrs
end
|
#created_at ⇒ Object
9
|
# File 'lib/printavo/models/invoice.rb', line 9
def created_at = self['createdAt']
|
#id ⇒ Object
6
|
# File 'lib/printavo/models/invoice.rb', line 6
def id = self['id']
|
#invoice_at ⇒ Object
15
|
# File 'lib/printavo/models/invoice.rb', line 15
def invoice_at = self['invoiceAt']
|
#nickname ⇒ Object
8
|
# File 'lib/printavo/models/invoice.rb', line 8
def nickname = self['nickname']
|
#paid_in_full? ⇒ Boolean
14
|
# File 'lib/printavo/models/invoice.rb', line 14
def paid_in_full? = self['paidInFull']
|
#payment_due_at ⇒ Object
16
|
# File 'lib/printavo/models/invoice.rb', line 16
def payment_due_at = self['paymentDueAt']
|
#status ⇒ Object
18
19
20
|
# File 'lib/printavo/models/invoice.rb', line 18
def status
dig('status', 'name')
end
|
#status?(key) ⇒ Boolean
36
37
38
|
# File 'lib/printavo/models/invoice.rb', line 36
def status?(key)
status_key == key.to_sym
end
|
#status_color ⇒ Object
26
27
28
|
# File 'lib/printavo/models/invoice.rb', line 26
def status_color
dig('status', 'color')
end
|
#status_id ⇒ Object
22
23
24
|
# File 'lib/printavo/models/invoice.rb', line 22
def status_id
dig('status', 'id')
end
|
#status_key ⇒ Object
30
31
32
33
34
|
# File 'lib/printavo/models/invoice.rb', line 30
def status_key
return nil if status.nil?
status.downcase.gsub(/\s+/, '_').to_sym
end
|
#total ⇒ Object
11
|
# File 'lib/printavo/models/invoice.rb', line 11
def total = self['total']
|
#updated_at ⇒ Object
10
|
# File 'lib/printavo/models/invoice.rb', line 10
def updated_at = self['updatedAt']
|
#visual_id ⇒ Object
7
|
# File 'lib/printavo/models/invoice.rb', line 7
def visual_id = self['visualId']
|