Class: ISO4217::Currency
- Inherits:
-
Object
- Object
- ISO4217::Currency
- Defined in:
- lib/iso4217/currency.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#sign ⇒ Object
readonly
Returns the value of attribute sign.
Instance Method Summary collapse
-
#initialize(code, sign, name) ⇒ Currency
constructor
A new instance of Currency.
- #to_s ⇒ Object
Constructor Details
#initialize(code, sign, name) ⇒ Currency
Returns a new instance of Currency.
5 6 7 |
# File 'lib/iso4217/currency.rb', line 5 def initialize(code, sign, name) @code, @sign, @name = code, utf8(sign), name end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/iso4217/currency.rb', line 3 def code @code end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/iso4217/currency.rb', line 3 def name @name end |
#sign ⇒ Object (readonly)
Returns the value of attribute sign.
3 4 5 |
# File 'lib/iso4217/currency.rb', line 3 def sign @sign end |
Instance Method Details
#to_s ⇒ Object
9 10 11 |
# File 'lib/iso4217/currency.rb', line 9 def to_s "Code: #{@code} | Sign: #{@sign} | Currency: #{@name}" end |