Class: Files::PaymentLineItem

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/payment_line_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ PaymentLineItem

Returns a new instance of PaymentLineItem.



9
10
11
12
# File 'lib/files.com/models/payment_line_item.rb', line 9

def initialize(attributes = {}, options = {})
  @attributes = attributes || {}
  @options = options || {}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



7
8
9
# File 'lib/files.com/models/payment_line_item.rb', line 7

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/files.com/models/payment_line_item.rb', line 7

def options
  @options
end

Instance Method Details

#amountObject

decimal - Payment line item amount



15
16
17
18
19
20
# File 'lib/files.com/models/payment_line_item.rb', line 15

def amount
  value = @attributes[:amount]
  return value if value.nil? || value.is_a?(BigDecimal)

  BigDecimal(value.to_s)
end

#created_atObject

date-time - Payment line item created at date/time



23
24
25
# File 'lib/files.com/models/payment_line_item.rb', line 23

def created_at
  @attributes[:created_at]
end

#invoice_idObject

int64 - Invoice ID



28
29
30
# File 'lib/files.com/models/payment_line_item.rb', line 28

def invoice_id
  @attributes[:invoice_id]
end

#payment_idObject

int64 - Payment ID



33
34
35
# File 'lib/files.com/models/payment_line_item.rb', line 33

def payment_id
  @attributes[:payment_id]
end