Class: Braintree::Transaction::Installment
- Inherits:
-
Object
- Object
- Braintree::Transaction::Installment
- Includes:
- BaseModule
- Defined in:
- lib/braintree/transaction/installment.rb,
lib/braintree/transaction/installment/adjustment.rb
Defined Under Namespace
Classes: Adjustment
Instance Attribute Summary collapse
-
#actual_disbursement_date ⇒ Object
readonly
Returns the value of attribute actual_disbursement_date.
-
#adjustments ⇒ Object
readonly
Returns the value of attribute adjustments.
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#projected_disbursement_date ⇒ Object
readonly
Returns the value of attribute projected_disbursement_date.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Installment
constructor
A new instance of Installment.
- #inspect ⇒ Object
Methods included from BaseModule
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_date ⇒ Object (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 |
#adjustments ⇒ Object (readonly)
Returns the value of attribute adjustments.
10 11 12 |
# File 'lib/braintree/transaction/installment.rb', line 10 def adjustments @adjustments end |
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
7 8 9 |
# File 'lib/braintree/transaction/installment.rb', line 7 def amount @amount end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/braintree/transaction/installment.rb', line 6 def id @id end |
#projected_disbursement_date ⇒ Object (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
#inspect ⇒ Object
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 |