Class: TableVarEntry
- Inherits:
-
Object
- Object
- TableVarEntry
- Defined in:
- lib/data_request.rb
Instance Attribute Summary collapse
-
#frequency_name ⇒ Object
readonly
Returns the value of attribute frequency_name.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
-
#time_method ⇒ Object
readonly
Returns the value of attribute time_method.
Instance Method Summary collapse
- #cell_measures ⇒ Object
- #cell_methods ⇒ Object
- #description ⇒ Object
-
#initialize(variable_entry_key:, entry_data:, table:) ⇒ TableVarEntry
constructor
A new instance of TableVarEntry.
- #realms ⇒ Object
- #standard_name ⇒ Object
- #unit ⇒ Object
- #variable_id ⇒ Object
Constructor Details
#initialize(variable_entry_key:, entry_data:, table:) ⇒ TableVarEntry
Returns a new instance of TableVarEntry.
193 194 195 196 197 198 199 |
# File 'lib/data_request.rb', line 193 def initialize(variable_entry_key:, entry_data:, table:) @variable_entry_key = variable_entry_key @data = entry_data @table = table @frequency_name = @data['frequency'] @time_method = Frequency.for_name(@data['frequency']).time_method end |
Instance Attribute Details
#frequency_name ⇒ Object (readonly)
Returns the value of attribute frequency_name.
190 191 192 |
# File 'lib/data_request.rb', line 190 def frequency_name @frequency_name end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
190 191 192 |
# File 'lib/data_request.rb', line 190 def table @table end |
#time_method ⇒ Object (readonly)
Returns the value of attribute time_method.
190 191 192 |
# File 'lib/data_request.rb', line 190 def time_method @time_method end |
Instance Method Details
#cell_measures ⇒ Object
232 233 234 |
# File 'lib/data_request.rb', line 232 def cell_measures @data['cell_measures'] end |
#cell_methods ⇒ Object
227 228 229 |
# File 'lib/data_request.rb', line 227 def cell_methods @data['cell_methods'] end |
#description ⇒ Object
212 213 214 |
# File 'lib/data_request.rb', line 212 def description @data['comment'] end |
#realms ⇒ Object
217 218 219 |
# File 'lib/data_request.rb', line 217 def realms @data['modeling_realm'].split(' ') end |
#standard_name ⇒ Object
222 223 224 |
# File 'lib/data_request.rb', line 222 def standard_name @data['standard_name'] end |
#unit ⇒ Object
207 208 209 |
# File 'lib/data_request.rb', line 207 def unit @data['units'] end |
#variable_id ⇒ Object
202 203 204 |
# File 'lib/data_request.rb', line 202 def variable_id @variable_entry_key # it is not clear whether the variable_id is stored as 'out_name' or the 'variable_entry' key as these differ for e.g. difmxybo in data request 0.1.00.27 end |