Class: VirtualMerchant::Amount
- Inherits:
-
Object
- Object
- VirtualMerchant::Amount
- Defined in:
- lib/virtual_merchant/amount.rb
Instance Attribute Summary collapse
-
#billing_cycle ⇒ Object
Returns the value of attribute billing_cycle.
-
#end_of_month ⇒ Object
Returns the value of attribute end_of_month.
-
#next_payment_date ⇒ Object
Returns the value of attribute next_payment_date.
-
#tax ⇒ Object
Returns the value of attribute tax.
-
#total ⇒ Object
Returns the value of attribute total.
Instance Method Summary collapse
-
#initialize(info) ⇒ Amount
constructor
A new instance of Amount.
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_cycle ⇒ Object
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_month ⇒ Object
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_date ⇒ Object
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 |
#tax ⇒ Object
Returns the value of attribute tax.
3 4 5 |
# File 'lib/virtual_merchant/amount.rb', line 3 def tax @tax end |
#total ⇒ Object
Returns the value of attribute total.
3 4 5 |
# File 'lib/virtual_merchant/amount.rb', line 3 def total @total end |