Class: Ebisu::Payment

Inherits:
Object
  • Object
show all
Defined in:
lib/ebisu/models/payment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Payment

Returns a new instance of Payment.



6
7
8
9
10
11
12
13
14
15
# File 'lib/ebisu/models/payment.rb', line 6

def initialize(data)
  @method = case data['Method']
            when Array
              data['Method'].map { |x| PaymentMethod.new(x) }
            when NilClass
              []
            else
              [PaymentMethod.new(data)]
            end
end

Instance Attribute Details

#methodObject

Returns the value of attribute method.



5
6
7
# File 'lib/ebisu/models/payment.rb', line 5

def method
  @method
end