Class: Mint::Currency

Inherits:
Object
  • Object
show all
Defined in:
lib/minting/mint/currency.rb

Overview

Represents a specific currency unit, identified by ISO 4217 alphabetic code

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



6
7
8
# File 'lib/minting/mint/currency.rb', line 6

def code
  @code
end

#subunitObject (readonly)

Returns the value of attribute subunit.



6
7
8
# File 'lib/minting/mint/currency.rb', line 6

def subunit
  @subunit
end

#symbolObject (readonly)

Returns the value of attribute symbol.



6
7
8
# File 'lib/minting/mint/currency.rb', line 6

def symbol
  @symbol
end

Instance Method Details

#inspectObject



8
9
10
# File 'lib/minting/mint/currency.rb', line 8

def inspect
  "<Currency:(#{code} #{symbol} #{subunit})>"
end

#minimum_amountObject



12
13
14
# File 'lib/minting/mint/currency.rb', line 12

def minimum_amount
  @minimum_amount ||= 10r**-subunit
end