Class: VirtualMerchant::Amount

Inherits:
Object
  • Object
show all
Defined in:
lib/virtual_merchant/amount.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(info) ⇒ Amount

Returns a new instance of Amount.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/virtual_merchant/amount.rb', line 5

def initialize(info)
  @total = sprintf( "%0.02f", info[:total])
  if info[:tax]
    @tax = sprintf( "%0.02f", info[:tax])
  else
    @tax = "0.00"
  end
  @next_payment_date = info[:next_payment_date]
  @billing_cycle = info[:billing_cycle]
  @end_of_month = info[:end_of_month] || 'Y'
end

Instance Attribute Details

#billing_cycleObject

Returns the value of attribute billing_cycle.



3
4
5
# File 'lib/virtual_merchant/amount.rb', line 3

def billing_cycle
  @billing_cycle
end

#end_of_monthObject

Returns the value of attribute end_of_month.



3
4
5
# File 'lib/virtual_merchant/amount.rb', line 3

def end_of_month
  @end_of_month
end

#next_payment_dateObject

Returns the value of attribute next_payment_date.



3
4
5
# File 'lib/virtual_merchant/amount.rb', line 3

def next_payment_date
  @next_payment_date
end

#taxObject

Returns the value of attribute tax.



3
4
5
# File 'lib/virtual_merchant/amount.rb', line 3

def tax
  @tax
end

#totalObject

Returns the value of attribute total.



3
4
5
# File 'lib/virtual_merchant/amount.rb', line 3

def total
  @total
end