Class: NexosisApi::SessionResponse
- Defined in:
- lib/nexosis_api/session_response.rb
Overview
Class to parse the results from a new session
Instance Attribute Summary collapse
-
#account_balance ⇒ String
Remaining balance after charge for this session.
-
#cost ⇒ String
The cost of this session with currency identifier.
Attributes inherited from Session
#dataSetName, #endDate, #extraParameters, #is_estimate, #links, #sessionId, #startDate, #status, #statusHistory, #targetColumn, #type
Instance Method Summary collapse
-
#initialize(forecast_hash) ⇒ SessionResponse
constructor
A new instance of SessionResponse.
Constructor Details
#initialize(forecast_hash) ⇒ SessionResponse
Returns a new instance of SessionResponse.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/nexosis_api/session_response.rb', line 6 def initialize(forecast_hash) forecast_hash.each do |k,v| if(k == "session") super(v) unless v.nil? elsif(k == "nexosis-request-cost") instance_variable_set("@cost", v[0]) unless v.nil? elsif(k == "nexosis-account-balance") instance_variable_set("@account_balance", v[0]) unless v.nil? end end end |
Instance Attribute Details
#account_balance ⇒ String
Remaining balance after charge for this session
24 25 26 |
# File 'lib/nexosis_api/session_response.rb', line 24 def account_balance @account_balance end |
#cost ⇒ String
The cost of this session with currency identifier
20 21 22 |
# File 'lib/nexosis_api/session_response.rb', line 20 def cost @cost end |