Class: NexosisApi::Session
- Inherits:
-
Object
- Object
- NexosisApi::Session
- Defined in:
- lib/nexosis_api/session.rb
Overview
Class for parsing the results of a session based request
Direct Known Subclasses
Instance Attribute Summary collapse
-
#column_metadata ⇒ Object
The column descriptors for the data in this session will reflect either the metadata sent in, defaults form dataset, or inferred values @return[Array of NexosisApi::DatasetColumn].
-
#dataSetName ⇒ String
the dataset used in this session.
-
#endDate ⇒ DateTime
The end date of analysis in this session.
-
#extraParameters ⇒ Hash
reserved for future extensions.
-
#is_estimate ⇒ Boolean
Is this session an estimate only session.
-
#links ⇒ Array of NexosisApi::Link
associated hypermedia.
-
#result_interval ⇒ NexosisApi::TimeInterval
The requested result interval.
-
#sessionId ⇒ String
identifier for this sesssion.
-
#startDate ⇒ DateTime
The start date of analysis in this session.
-
#status ⇒ String
Is this session requested, estimated, started, or completed.
-
#statusHistory ⇒ Hash
Date and status of each status this session has entered.
-
#targetColumn ⇒ String
The column in the dataset for which this session ran predictions.
-
#type ⇒ String
What type of analysis was run during this session.
Instance Method Summary collapse
-
#initialize(sessionHash) ⇒ Session
constructor
A new instance of Session.
Constructor Details
#initialize(sessionHash) ⇒ Session
Returns a new instance of Session.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/nexosis_api/session.rb', line 4 def initialize(sessionHash) sessionHash.each do |k,v| if(k == "links") links = Array.new v.each do |l| links << NexosisApi::Link.new(l) end instance_variable_set("@#{k}", links) unless v.nil? elsif(k == "isEstimate") instance_variable_set("@is_estimate", v) unless v.nil? elsif(k == "columns") columns = [] next if v.nil? v.keys.each do |col_key| columns << NexosisApi::DatasetColumn.new(col_key, v[col_key]) end @column_metadata = columns elsif(k == "resultInterval") @result_interval = v else instance_variable_set("@#{k}", v) unless v.nil? end end end |
Instance Attribute Details
#column_metadata ⇒ Object
The column descriptors for the data in this session
will reflect either the metadata sent in, defaults form dataset, or inferred values
@return[Array of NexosisApi::DatasetColumn]
74 75 76 |
# File 'lib/nexosis_api/session.rb', line 74 def @column_metadata end |
#dataSetName ⇒ String
the dataset used in this session
49 50 51 |
# File 'lib/nexosis_api/session.rb', line 49 def dataSetName @dataSetName end |
#endDate ⇒ DateTime
The end date of analysis in this session
61 62 63 |
# File 'lib/nexosis_api/session.rb', line 61 def endDate @endDate end |
#extraParameters ⇒ Hash
reserved for future extensions
45 46 47 |
# File 'lib/nexosis_api/session.rb', line 45 def extraParameters @extraParameters end |
#is_estimate ⇒ Boolean
Is this session an estimate only session
69 70 71 |
# File 'lib/nexosis_api/session.rb', line 69 def is_estimate @is_estimate end |
#links ⇒ Array of NexosisApi::Link
associated hypermedia
65 66 67 |
# File 'lib/nexosis_api/session.rb', line 65 def links @links end |
#result_interval ⇒ NexosisApi::TimeInterval
The requested result interval. Default is DAY if none was requested during session creation.
78 79 80 |
# File 'lib/nexosis_api/session.rb', line 78 def result_interval @result_interval end |
#sessionId ⇒ String
identifier for this sesssion
29 30 31 |
# File 'lib/nexosis_api/session.rb', line 29 def sessionId @sessionId end |
#startDate ⇒ DateTime
The start date of analysis in this session
57 58 59 |
# File 'lib/nexosis_api/session.rb', line 57 def startDate @startDate end |
#status ⇒ String
Is this session requested, estimated, started, or completed
37 38 39 |
# File 'lib/nexosis_api/session.rb', line 37 def status @status end |
#statusHistory ⇒ Hash
Date and status of each status this session has entered
41 42 43 |
# File 'lib/nexosis_api/session.rb', line 41 def statusHistory @statusHistory end |
#targetColumn ⇒ String
The column in the dataset for which this session ran predictions
53 54 55 |
# File 'lib/nexosis_api/session.rb', line 53 def targetColumn @targetColumn end |
#type ⇒ String
What type of analysis was run during this session
33 34 35 |
# File 'lib/nexosis_api/session.rb', line 33 def type @type end |