Class: Braintree::Transaction::Installment

Inherits:
Object
  • Object
show all
Includes:
BaseModule
Defined in:
lib/braintree/transaction/installment.rb,
lib/braintree/transaction/installment/adjustment.rb

Defined Under Namespace

Classes: Adjustment

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BaseModule

included

Methods included from BaseModule::Methods

#copy_instance_variables_from_object, #return_object_or_raise, #set_instance_variables_from_hash, #singleton_class

Constructor Details

#initialize(attributes) ⇒ Installment

Returns a new instance of Installment.



12
13
14
15
16
# File 'lib/braintree/transaction/installment.rb', line 12

def initialize(attributes)
  set_instance_variables_from_hash attributes unless attributes.nil?
  @amount = Util.to_big_decimal(amount)
  adjustments.map! { |attrs| Adjustment.new(attrs) } if adjustments
end

Instance Attribute Details

#actual_disbursement_dateObject (readonly)

Returns the value of attribute actual_disbursement_date.



9
10
11
# File 'lib/braintree/transaction/installment.rb', line 9

def actual_disbursement_date
  @actual_disbursement_date
end

#adjustmentsObject (readonly)

Returns the value of attribute adjustments.



10
11
12
# File 'lib/braintree/transaction/installment.rb', line 10

def adjustments
  @adjustments
end

#amountObject (readonly)

Returns the value of attribute amount.



7
8
9
# File 'lib/braintree/transaction/installment.rb', line 7

def amount
  @amount
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/braintree/transaction/installment.rb', line 6

def id
  @id
end

#projected_disbursement_dateObject (readonly)

Returns the value of attribute projected_disbursement_date.



8
9
10
# File 'lib/braintree/transaction/installment.rb', line 8

def projected_disbursement_date
  @projected_disbursement_date
end

Instance Method Details

#inspectObject



18
19
20
21
22
23
24
25
# File 'lib/braintree/transaction/installment.rb', line 18

def inspect
  attrs = [:id, :amount, :projected_disbursement_date, :actual_disbursement_date, :adjustments]
  formatted_attrs = attrs.map do |attr|
    "#{attr}: #{send(attr).inspect}"
  end

  "#<#{formatted_attrs.join(", ")}>"
end