Class: ExchangeRatesGenerator::Currency
- Inherits:
-
Object
- Object
- ExchangeRatesGenerator::Currency
- Defined in:
- lib/exchange-rates-generator/currency.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#entities ⇒ Object
readonly
Returns the value of attribute entities.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(code, name, entities) ⇒ Currency
constructor
A new instance of Currency.
- #to_s ⇒ Object
Constructor Details
#initialize(code, name, entities) ⇒ Currency
Returns a new instance of Currency.
5 6 7 8 9 |
# File 'lib/exchange-rates-generator/currency.rb', line 5 def initialize(code, name, entities) @code = code.downcase.to_sym @name = name @entity = entities end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/exchange-rates-generator/currency.rb', line 3 def code @code end |
#entities ⇒ Object (readonly)
Returns the value of attribute entities.
3 4 5 |
# File 'lib/exchange-rates-generator/currency.rb', line 3 def entities @entities end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/exchange-rates-generator/currency.rb', line 3 def name @name end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/exchange-rates-generator/currency.rb', line 11 def to_s "#{name} (#{@code})" end |