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 ⇒ NexosisApi::PagedArray of Hash
The hash of data values from the dataset.
-
#is_timeseries ⇒ Boolean
readonly
Whether or not this dataset was loaded with a date-based key with a timestamp role.
-
#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
#initialize(data_hash) ⇒ DatasetData
Returns a new instance of DatasetData.
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/nexosis_api/dataset_data.rb', line 4 def initialize(data_hash) data_hash.each do |k, v| if (k == 'data') @data = NexosisApi::PagedArray.new(data_hash, v) elsif (k == 'links') @links = v.reject(&:nil?).map { |l| NexosisApi::Link.new(l) } elsif (k == 'isTimeSeries') @is_timeseries = v end end end |
Instance Attribute Details
#data ⇒ NexosisApi::PagedArray of Hash
The hash of data values from the dataset
22 23 24 |
# File 'lib/nexosis_api/dataset_data.rb', line 22 def data @data end |
#is_timeseries ⇒ Boolean (readonly)
Whether or not this dataset was loaded with a date-based key with a timestamp role
27 28 29 |
# File 'lib/nexosis_api/dataset_data.rb', line 27 def is_timeseries @is_timeseries end |
#links ⇒ Array of NexosisApi::Link
Helpful links to more information about this dataset
18 19 20 |
# File 'lib/nexosis_api/dataset_data.rb', line 18 def links @links end |