Class: RePricingNl::DataWrapper
- Inherits:
-
Object
- Object
- RePricingNl::DataWrapper
- Defined in:
- lib/re-pricing-nl/data_wrapper.rb
Constant Summary collapse
- ENDPOINT =
"https://cpi-nl.heroku.com/frontend/cpi_values"
Class Method Summary collapse
-
.get_cpi_index(options = {}) ⇒ Object
get_cpi_index.
Class Method Details
.get_cpi_index(options = {}) ⇒ Object
get_cpi_index
Returns a float > 1.0 (e.g. 1.025 = 2,5%) that specifies the CPI for this period.
Mandatory arguments:
- month: Month for the CPI.
- year: Year for the CPI.
Optional arguments:
- cpi_value, a Hash with keys:
- cpi_method: CPI method
- period: CPI period
- cpi_type: CPI type
- base_year: CPI base year
Returns Float or nil if not available.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/re-pricing-nl/data_wrapper.rb', line 32 def self.get_cpi_index( = {}) OptionsChecker.check , [ :month, :year ] ret = nil # Get the resource from the web service # And mould it into a CpiValue object. cpi_value = CpiValue.new( CpiValue.get( :show, :cpi_value => )) # +_+ # ret = cpi_value.index # Nice :D ret end |