Class: Mint::Currency
- Inherits:
-
Object
- Object
- Mint::Currency
- Defined in:
- lib/minting/mint/currency.rb
Overview
Represents a specific currency unit, identified by ISO 4217 alphabetic ocde
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#subunit ⇒ Object
readonly
Returns the value of attribute subunit.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Instance Method Summary collapse
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
8 9 10 |
# File 'lib/minting/mint/currency.rb', line 8 def code @code end |
#subunit ⇒ Object (readonly)
Returns the value of attribute subunit.
8 9 10 |
# File 'lib/minting/mint/currency.rb', line 8 def subunit @subunit end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
8 9 10 |
# File 'lib/minting/mint/currency.rb', line 8 def symbol @symbol end |
Instance Method Details
#inspect ⇒ Object
10 11 12 |
# File 'lib/minting/mint/currency.rb', line 10 def inspect "<Currency:(#{code} #{symbol} #{subunit})>" end |
#minimum_amount ⇒ Object
14 15 16 |
# File 'lib/minting/mint/currency.rb', line 14 def minimum_amount @minimum_amount ||= 10r**-subunit end |