Class: Braintree::Transaction::Installment::Adjustment

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

Defined Under Namespace

Modules: Kind

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) ⇒ Adjustment

Returns a new instance of Adjustment.



17
18
19
20
# File 'lib/braintree/transaction/installment/adjustment.rb', line 17

def initialize(attributes)
  set_instance_variables_from_hash attributes unless attributes.nil?
  @amount = Util.to_big_decimal(amount)
end

Instance Attribute Details

#actual_disbursement_dateObject (readonly)

Returns the value of attribute actual_disbursement_date.



15
16
17
# File 'lib/braintree/transaction/installment/adjustment.rb', line 15

def actual_disbursement_date
  @actual_disbursement_date
end

#amountObject (readonly)

Returns the value of attribute amount.



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

def amount
  @amount
end

#kindObject (readonly)

Returns the value of attribute kind.



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

def kind
  @kind
end

#projected_disbursement_dateObject (readonly)

Returns the value of attribute projected_disbursement_date.



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

def projected_disbursement_date
  @projected_disbursement_date
end

Instance Method Details

#inspectObject



22
23
24
25
26
27
28
29
# File 'lib/braintree/transaction/installment/adjustment.rb', line 22

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

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