Class: Reality::Extras::Quandl::Economy
- Inherits:
-
Object
- Object
- Reality::Extras::Quandl::Economy
- Defined in:
- lib/reality/extras/quandl.rb
Instance Method Summary collapse
- #gdp ⇒ Object
- #inflation ⇒ Object
-
#initialize(country) ⇒ Economy
constructor
A new instance of Economy.
- #inspect ⇒ Object
- #unemployment ⇒ Object
Constructor Details
#initialize(country) ⇒ Economy
Returns a new instance of Economy.
7 8 9 |
# File 'lib/reality/extras/quandl.rb', line 7 def initialize(country) @country = country end |
Instance Method Details
#gdp ⇒ Object
11 12 13 14 15 |
# File 'lib/reality/extras/quandl.rb', line 11 def gdp gdp = fetch("ODA/#{@country.iso3_code}_NGDPD") gdp = gdp.to_i * 1_000_000_000 Reality::Measure(gdp, '$') end |
#inflation ⇒ Object
17 18 19 20 |
# File 'lib/reality/extras/quandl.rb', line 17 def inflation inflation = fetch("ODA/#{@country.iso3_code}_PCPIPCH") Reality::Measure(inflation, '%') end |
#inspect ⇒ Object
27 28 29 |
# File 'lib/reality/extras/quandl.rb', line 27 def inspect "#<Reality::Quandl::Economy (%s)>" % [@country.name] end |