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.


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 = v
        elsif(k == "links")
            links = Array.new
					v.each do |l| links << NexosisApi::Link.new(l) end
					@links = links
        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


22
23
24
# File 'lib/nexosis_api/dataset_data.rb', line 22

def data
  @data
end

Helpful links to more information about this dataset

Returns:


18
19
20
# File 'lib/nexosis_api/dataset_data.rb', line 18

def links
  @links
end