Class: Timeprice::InflationResult

Inherits:
Data
  • Object
show all
Defined in:
lib/timeprice/inflation.rb,
lib/timeprice/cli.rb

Overview

Value object returned by Inflation.adjust.

granularity is one of:

:monthly                  — both ends resolved on monthly data
:annual                   — at least one end resolved on annual data
:annual_from_monthly_avg  — at least one end was an annual request resolved
                            by averaging 12 months of monthly data

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount

Returns:

  • (Object)

    the current value of amount



14
15
16
# File 'lib/timeprice/inflation.rb', line 14

def amount
  @amount
end

#countryObject (readonly)

Returns the value of attribute country

Returns:

  • (Object)

    the current value of country



14
15
16
# File 'lib/timeprice/inflation.rb', line 14

def country
  @country
end

#fromObject (readonly)

Returns the value of attribute from

Returns:

  • (Object)

    the current value of from



14
15
16
# File 'lib/timeprice/inflation.rb', line 14

def from
  @from
end

#from_indexObject (readonly)

Returns the value of attribute from_index

Returns:

  • (Object)

    the current value of from_index



14
15
16
# File 'lib/timeprice/inflation.rb', line 14

def from_index
  @from_index
end

#granularityObject (readonly)

Returns the value of attribute granularity

Returns:

  • (Object)

    the current value of granularity



14
15
16
# File 'lib/timeprice/inflation.rb', line 14

def granularity
  @granularity
end

#original_amountObject (readonly)

Returns the value of attribute original_amount

Returns:

  • (Object)

    the current value of original_amount



14
15
16
# File 'lib/timeprice/inflation.rb', line 14

def original_amount
  @original_amount
end

#toObject (readonly)

Returns the value of attribute to

Returns:

  • (Object)

    the current value of to



14
15
16
# File 'lib/timeprice/inflation.rb', line 14

def to
  @to
end

#to_indexObject (readonly)

Returns the value of attribute to_index

Returns:

  • (Object)

    the current value of to_index



14
15
16
# File 'lib/timeprice/inflation.rb', line 14

def to_index
  @to_index
end

Instance Method Details

#country_currency_labelObject



206
207
208
# File 'lib/timeprice/cli.rb', line 206

def country_currency_label
  Supported.currency_for_country(country) || country.to_s.upcase
end