Class: Retab::ExperimentVoteRow
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ExperimentVoteRow
- 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
-
#consensus ⇒ Object
Returns the value of attribute consensus.
-
#present_voter_count ⇒ Object
Returns the value of attribute present_voter_count.
-
#row_presence_score ⇒ Object
Returns the value of attribute row_presence_score.
-
#score ⇒ Object
Returns the value of attribute score.
-
#total_voter_count ⇒ Object
Returns the value of attribute total_voter_count.
-
#votes ⇒ Object
Returns the value of attribute votes.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ ExperimentVoteRow
constructor
A new instance of ExperimentVoteRow.
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
#consensus ⇒ Object
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_count ⇒ Object
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_score ⇒ Object
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 |
#score ⇒ Object
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_count ⇒ Object
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 |
#votes ⇒ Object
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 |