Class: Retab::ExperimentVoteRow

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

Constant Summary collapse

HASH_ATTRS =
{
  consensus: :consensus,
  votes: :votes,
  score: :score,
  row_presence_score: :row_presence_score,
  present_voter_count: :present_voter_count,
  total_voter_count: :total_voter_count
}.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) ⇒ ExperimentVoteRow

Returns a new instance of ExperimentVoteRow.



25
26
27
28
29
30
31
32
33
# File 'lib/retab/experiment_run_metrics/experiment_vote_row.rb', line 25

def initialize(json)
  hash = self.class.normalize(json)
  @consensus = hash[:consensus]
  @votes = (hash[:votes] || [])
  @score = hash[:score]
  @row_presence_score = hash[:row_presence_score]
  @present_voter_count = hash[:present_voter_count]
  @total_voter_count = hash[:total_voter_count]
end

Instance Attribute Details

#consensusObject

Returns the value of attribute consensus.



17
18
19
# File 'lib/retab/experiment_run_metrics/experiment_vote_row.rb', line 17

def consensus
  @consensus
end

#present_voter_countObject

Returns the value of attribute present_voter_count.



17
18
19
# File 'lib/retab/experiment_run_metrics/experiment_vote_row.rb', line 17

def present_voter_count
  @present_voter_count
end

#row_presence_scoreObject

Returns the value of attribute row_presence_score.



17
18
19
# File 'lib/retab/experiment_run_metrics/experiment_vote_row.rb', line 17

def row_presence_score
  @row_presence_score
end

#scoreObject

Returns the value of attribute score.



17
18
19
# File 'lib/retab/experiment_run_metrics/experiment_vote_row.rb', line 17

def score
  @score
end

#total_voter_countObject

Returns the value of attribute total_voter_count.



17
18
19
# File 'lib/retab/experiment_run_metrics/experiment_vote_row.rb', line 17

def total_voter_count
  @total_voter_count
end

#votesObject

Returns the value of attribute votes.



17
18
19
# File 'lib/retab/experiment_run_metrics/experiment_vote_row.rb', line 17

def votes
  @votes
end