Class: ExchangeRatesGenerator::Currency

Inherits:
Object
  • Object
show all
Defined in:
lib/exchange-rates-generator/currency.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject (readonly)

Returns the value of attribute code.



3
4
5
# File 'lib/exchange-rates-generator/currency.rb', line 3

def code
  @code
end

#entitiesObject (readonly)

Returns the value of attribute entities.



3
4
5
# File 'lib/exchange-rates-generator/currency.rb', line 3

def entities
  @entities
end

#nameObject (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_sObject



11
12
13
# File 'lib/exchange-rates-generator/currency.rb', line 11

def to_s
  "#{name} (#{@code})"
end