Class: NexosisApi::ColumnOptions
- Inherits:
-
Object
- Object
- NexosisApi::ColumnOptions
- Defined in:
- lib/nexosis_api/column_options.rb
Overview
Class for holding the join options on a column in a view-based join
Instance Attribute Summary collapse
-
#alias ⇒ String
Optional alias of the column when participating in a join or to merge two distinctly named columns.
-
#column_name ⇒ String
The name of the column on which these options are applied.
-
#join_interval ⇒ NexosisApi::TimeInterval
Optional interval of a time series column being joined to another time series.
Instance Method Summary collapse
-
#initialize(column_name, options_hash) ⇒ ColumnOptions
constructor
Create a new option for a join column.
-
#to_hash ⇒ Object
builds a custom hash which will match api requests.
Constructor Details
permalink #initialize(column_name, options_hash) ⇒ ColumnOptions
Create a new option for a join column.
8 9 10 11 12 |
# File 'lib/nexosis_api/column_options.rb', line 8 def initialize(column_name, ) @column_name = column_name @join_interval = NexosisApi::TimeInterval.const_get(['joinInterval'].upcase) unless ['joinInterval'].nil? @alias = ['alias'] end |
Instance Attribute Details
permalink #alias ⇒ String
An alias can be used to keep two same-named columns distinct
Optional alias of the column when participating in a join or to merge two distinctly named columns. By default same-named columns on two sides of a join will be merged.
28 29 30 |
# File 'lib/nexosis_api/column_options.rb', line 28 def alias @alias end |
permalink #column_name ⇒ String
The name of the column on which these options are applied
16 17 18 |
# File 'lib/nexosis_api/column_options.rb', line 16 def column_name @column_name end |
permalink #join_interval ⇒ NexosisApi::TimeInterval
not valid outside of join defintion
Optional interval of a time series column being joined to another time series
21 22 23 |
# File 'lib/nexosis_api/column_options.rb', line 21 def join_interval @join_interval end |
Instance Method Details
permalink #to_hash ⇒ Object
builds a custom hash which will match api requests
31 32 33 34 35 36 |
# File 'lib/nexosis_api/column_options.rb', line 31 def to_hash hash = { column_name => {} } hash[column_name]['join_interval'] = join_interval.to_s unless join_interval.nil? hash[column_name]['alias'] = @alias.to_s unless @alias.nil? hash end |