Sha256: c5a0916571244c32210860b9f2f93bb2e26764e7f26c1ada57f2e69e36e8cc48

Contents?: true

Size: 788 Bytes

Versions: 27

Compression:

Stored size: 788 Bytes

Contents

module Braintree
  class Transaction
    class Installment
      include BaseModule

      attr_reader :id
      attr_reader :amount
      attr_reader :projected_disbursement_date
      attr_reader :actual_disbursement_date
      attr_reader :adjustments

      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

      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
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
braintree-4.23.0 lib/braintree/transaction/installment.rb
braintree-4.22.0 lib/braintree/transaction/installment.rb
braintree-4.21.0 lib/braintree/transaction/installment.rb
braintree-4.20.0 lib/braintree/transaction/installment.rb
braintree-4.19.0 lib/braintree/transaction/installment.rb
braintree-4.18.0 lib/braintree/transaction/installment.rb
braintree-4.17.0 lib/braintree/transaction/installment.rb
braintree-4.16.0 lib/braintree/transaction/installment.rb
braintree-4.15.0 lib/braintree/transaction/installment.rb
braintree-4.14.0 lib/braintree/transaction/installment.rb
braintree-4.13.0 lib/braintree/transaction/installment.rb
braintree-4.12.0 lib/braintree/transaction/installment.rb
braintree-4.11.0 lib/braintree/transaction/installment.rb
braintree-4.10.0 lib/braintree/transaction/installment.rb
braintree-4.9.0 lib/braintree/transaction/installment.rb
braintree-4.8.0 lib/braintree/transaction/installment.rb
braintree-4.7.0 lib/braintree/transaction/installment.rb
braintree-4.6.0 lib/braintree/transaction/installment.rb
braintree-4.5.0 lib/braintree/transaction/installment.rb
braintree-4.4.0 lib/braintree/transaction/installment.rb