Class: NexosisApi::ViewData

Inherits:
ViewDefinition show all
Defined in:
lib/nexosis_api/view_data.rb

Overview

Class to hold the parsed results of a view data retrieval

Since:

  • 1.2.0

Instance Attribute Summary collapse

Attributes inherited from ViewDefinition

#column_metadata, #dataset_name, #is_timeseries, #joins, #view_name

Instance Method Summary collapse

Methods inherited from ViewDefinition

#to_json

Constructor Details

#initialize(viewdata_hash) ⇒ ViewData

Returns a new instance of ViewData.

Since:

  • 1.2.0


5
6
7
8
# File 'lib/nexosis_api/view_data.rb', line 5

def initialize(viewdata_hash)
  @data = viewdata_hash['data']
  super(viewdata_hash.reject { |k| k == 'data' })
end

Instance Attribute Details

#dataArray of Hash

An array of hashes representing the processed data of the view

Returns:

  • (Array of Hash)
    • one hash per row of data where key = column name

Since:

  • 1.2.0


12
13
14
# File 'lib/nexosis_api/view_data.rb', line 12

def data
  @data
end