Class: Timeprice::MetadataSnapshot

Inherits:
Data
  • Object
show all
Defined in:
lib/timeprice/metadata_snapshot.rb

Overview

Frozen value object describing the bundled dataset: version, refresh date, country list with CPI ranges, currency list with display names, and FX coverage. Replaces the previous Hash return shape on metadata.

‘[]`, `to_h`, and `to_json` are kept compatible with the old Hash interface so downstream consumers (the website, this gem’s specs) don’t need a coordinated rewrite.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countriesObject (readonly)

Returns the value of attribute countries

Returns:

  • (Object)

    the current value of countries



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

def countries
  @countries
end

#currenciesObject (readonly)

Returns the value of attribute currencies

Returns:

  • (Object)

    the current value of currencies



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

def currencies
  @currencies
end

#fxObject (readonly)

Returns the value of attribute fx

Returns:

  • (Object)

    the current value of fx



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

def fx
  @fx
end

#generated_atObject (readonly)

Returns the value of attribute generated_at

Returns:

  • (Object)

    the current value of generated_at



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

def generated_at
  @generated_at
end

#versionObject (readonly)

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



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

def version
  @version
end

Instance Method Details

#[](key) ⇒ Object



15
16
17
# File 'lib/timeprice/metadata_snapshot.rb', line 15

def [](key)
  to_h[key]
end

#to_json(*args) ⇒ Object



19
20
21
# File 'lib/timeprice/metadata_snapshot.rb', line 19

def to_json(*args)
  to_h.to_json(*args)
end