Class: TableVarEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/data_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject (readonly)

Returns the value of attribute frequency_name.



190
191
192
# File 'lib/data_request.rb', line 190

def frequency_name
  @frequency_name
end

#tableObject (readonly)

Returns the value of attribute table.



190
191
192
# File 'lib/data_request.rb', line 190

def table
  @table
end

#time_methodObject (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_measuresObject



232
233
234
# File 'lib/data_request.rb', line 232

def cell_measures
  @data['cell_measures']
end

#cell_methodsObject



227
228
229
# File 'lib/data_request.rb', line 227

def cell_methods
  @data['cell_methods']
end

#descriptionObject



212
213
214
# File 'lib/data_request.rb', line 212

def description
   @data['comment']
end

#realmsObject



217
218
219
# File 'lib/data_request.rb', line 217

def realms
  @data['modeling_realm'].split(' ')
end

#standard_nameObject



222
223
224
# File 'lib/data_request.rb', line 222

def standard_name
  @data['standard_name']
end

#unitObject



207
208
209
# File 'lib/data_request.rb', line 207

def unit
   @data['units']
end

#variable_idObject



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