Class: Retab::ExperimentVotesMetricsResponse

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/experiment_run_metrics/experiment_votes_metrics_response.rb

Constant Summary collapse

HASH_ATTRS =
{
  run_id: :run_id,
  kind: :kind,
  view: :view,
  document: :document,
  target: :target,
  score: :score,
  prior_score: :prior_score,
  rows: :rows
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ ExperimentVotesMetricsResponse

Returns a new instance of ExperimentVotesMetricsResponse.



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/retab/experiment_run_metrics/experiment_votes_metrics_response.rb', line 29

def initialize(json)
  hash = self.class.normalize(json)
  @run_id = hash[:run_id]
  @kind = hash[:kind]
  @view = hash[:view]
  @document = hash[:document] ? Retab::ExperimentVotesMetricDocument.new(hash[:document]) : nil
  @target = hash[:target]
  @score = hash[:score]
  @prior_score = hash[:prior_score]
  @rows = (hash[:rows] || []).map { |item| item ? Retab::ExperimentVoteRow.new(item) : nil }
end

Instance Attribute Details

#documentObject

Returns the value of attribute document.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_votes_metrics_response.rb', line 19

def document
  @document
end

#kindObject

Returns the value of attribute kind.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_votes_metrics_response.rb', line 19

def kind
  @kind
end

#prior_scoreObject

Returns the value of attribute prior_score.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_votes_metrics_response.rb', line 19

def prior_score
  @prior_score
end

#rowsObject

Returns the value of attribute rows.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_votes_metrics_response.rb', line 19

def rows
  @rows
end

#run_idObject

Returns the value of attribute run_id.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_votes_metrics_response.rb', line 19

def run_id
  @run_id
end

#scoreObject

Returns the value of attribute score.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_votes_metrics_response.rb', line 19

def score
  @score
end

#targetObject

Returns the value of attribute target.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_votes_metrics_response.rb', line 19

def target
  @target
end

#viewObject

Returns the value of attribute view.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_votes_metrics_response.rb', line 19

def view
  @view
end