Class: Simplepay::Support::SimpleAmount

Inherits:
Object
  • Object
show all
Defined in:
lib/simplepay/support/simple_amount.rb

Overview

In new Amazon API requests the amount does not include the currency, SimpleAmount is used for this, for now.

At the present time, Amazon only uses USD.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(amount) ⇒ SimpleAmount

Returns a new instance of SimpleAmount.



15
16
17
# File 'lib/simplepay/support/simple_amount.rb', line 15

def initialize(amount)
  self.amount   = amount
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



13
14
15
# File 'lib/simplepay/support/simple_amount.rb', line 13

def amount
  @amount
end

Instance Method Details

#to_sObject



30
31
32
# File 'lib/simplepay/support/simple_amount.rb', line 30

def to_s
  "#{'%0.2f' % amount}"
end