Class: ExchangeRate::Currency
- Inherits:
-
Object
- Object
- ExchangeRate::Currency
- Defined in:
- lib/exchange_rate/currency.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attr = {}) ⇒ Currency
constructor
A new instance of Currency.
Constructor Details
#initialize(attr = {}) ⇒ Currency
Returns a new instance of Currency.
5 6 7 |
# File 'lib/exchange_rate/currency.rb', line 5 def initialize(attr={}) @name = attr.delete(:name) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/exchange_rate/currency.rb', line 3 def name @name end |
Class Method Details
.all ⇒ Object
9 10 11 12 13 |
# File 'lib/exchange_rate/currency.rb', line 9 def self.all @all_currencies ||= data_source.currency_names.map do |name| new(:name => name) end end |