Method: NexosisApi::SessionSelectionMetrics#initialize

Defined in:
lib/nexosis_api/session_selection_metrics.rb

#initialize(metrics_hash) ⇒ SessionSelectionMetrics

Returns a new instance of SessionSelectionMetrics.

Since:

  • 2.0.0

[View source]

5
6
7
8
9
10
11
# File 'lib/nexosis_api/session_selection_metrics.rb', line 5

def initialize(metrics_hash)
  if !metrics_hash['metricSets'].nil?
    @dataset_properties = metrics_hash['metricSets'][0]['dataSetProperties'] unless metrics_hash['metricSets'][0]['dataSetProperties'].nil?
    @metrics = metrics_hash['metricSets'][0]['metrics'] unless metrics_hash['metricSets'][0]['metrics'].nil?
  end
  super(metrics_hash.reject { |k, _v| k == 'metricSets' })
end