Class: NexosisApi::DatasetColumn
- Inherits:
-
Object
- Object
- NexosisApi::DatasetColumn
- Defined in:
- lib/nexosis_api/dataset_column.rb
Overview
class to hold the parsed results of a dataset column
Instance Attribute Summary collapse
-
#name ⇒ String
The column header, label, or name.
-
#role ⇒ NexosisApi::ColumnRole
The role of this column.
-
#type ⇒ NexosisApi::ColumnType
The data type of this column.
Instance Method Summary collapse
-
#initialize(column_name, value_hash) ⇒ DatasetColumn
constructor
A new instance of DatasetColumn.
Constructor Details
#initialize(column_name, value_hash) ⇒ DatasetColumn
Returns a new instance of DatasetColumn.
4 5 6 7 8 |
# File 'lib/nexosis_api/dataset_column.rb', line 4 def initialize(column_name, value_hash) @name = column_name @type = NexosisApi::ColumnType.const_get(value_hash["dataType"].upcase) unless value_hash["dataType"].nil? @role = NexosisApi::ColumnRole.const_get(value_hash["role"].upcase) unless value_hash["role"].nil? end |
Instance Attribute Details
#name ⇒ String
The column header, label, or name
11 12 13 |
# File 'lib/nexosis_api/dataset_column.rb', line 11 def name @name end |
#role ⇒ NexosisApi::ColumnRole
Note:
Either none, timestamp, target, or feature
The role of this column
22 23 24 |
# File 'lib/nexosis_api/dataset_column.rb', line 22 def role @role end |
#type ⇒ NexosisApi::ColumnType
Note:
Either string, numeric, logical, or date
The data type of this column
17 18 19 |
# File 'lib/nexosis_api/dataset_column.rb', line 17 def type @type end |