Class: NexosisApi::DatasetData

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

Overview

class to hold the parsed results of a dataset

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data_hash) ⇒ DatasetData

Returns a new instance of DatasetData.

[View source]

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

#dataArray of Hash

The hash of data values from the dataset

Returns:

  • (Array of Hash)

    where each hash contains the dataset data


20
21
22
# File 'lib/nexosis_api/dataset_data.rb', line 20

def data
  @data
end

Helpful links to more information about this dataset

Returns:


16
17
18
# File 'lib/nexosis_api/dataset_data.rb', line 16

def links
  @links
end