Class: Fxify::ECBData
- Inherits:
-
Object
- Object
- Fxify::ECBData
- Defined in:
- lib/fxify/base_class.rb,
lib/fxify/nested_classes.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Currency, ExchangeDate
Constant Summary collapse
- ECB_90_DAYS_URL =
"http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml"
Instance Method Summary collapse
- #currencies ⇒ Object
- #dates ⇒ Object
-
#initialize ⇒ ECBData
constructor
A new instance of ECBData.
Constructor Details
#initialize ⇒ ECBData
Returns a new instance of ECBData.
7 8 9 10 11 12 |
# File 'lib/fxify/base_class.rb', line 7 def initialize @days = [] fetch_data("data.xml") @data_file = Nokogiri::XML File.open("data.xml") parse_xml end |
Instance Method Details
#currencies ⇒ Object
14 15 16 |
# File 'lib/fxify/base_class.rb', line 14 def currencies @days.first.currencies.map { |c| c.name } end |
#dates ⇒ Object
18 19 20 |
# File 'lib/fxify/base_class.rb', line 18 def dates @days.map { |d| d.day } end |