Class: NexosisApi::DatasetData
- Inherits:
-
Object
- Object
- NexosisApi::DatasetData
- Defined in:
- lib/nexosis_api/dataset_data.rb
Overview
class to hold the parsed results of a dataset
Instance Attribute Summary collapse
-
#data ⇒ Array of Hash
The hash of data values from the dataset.
-
#links ⇒ Array of NexosisApi::Link
Helpful links to more information about this dataset.
Instance Method Summary collapse
-
#initialize(data_hash) ⇒ DatasetData
constructor
A new instance of DatasetData.
Constructor Details
permalink #initialize(data_hash) ⇒ DatasetData
Returns a new instance of DatasetData.
4 5 6 7 8 9 10 11 12 |
# File 'lib/nexosis_api/dataset_data.rb', line 4 def initialize(data_hash) data_hash.each do |k, v| if (k == 'data') @data = v elsif (k == 'links') @links = v.reject(&:nil?).map { |l| NexosisApi::Link.new(l) } end end end |
Instance Attribute Details
permalink #data ⇒ Array of Hash
The hash of data values from the dataset
20 21 22 |
# File 'lib/nexosis_api/dataset_data.rb', line 20 def data @data end |
permalink #links ⇒ Array of NexosisApi::Link
Helpful links to more information about this dataset
16 17 18 |
# File 'lib/nexosis_api/dataset_data.rb', line 16 def links @links end |