Class: Candidate
- Inherits:
-
Candidates
- Object
- Candidates
- Candidate
- Defined in:
- lib/my_segments/candidates.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#misspelled ⇒ Object
Returns the value of attribute misspelled.
-
#solution ⇒ Object
Returns the value of attribute solution.
-
#votes ⇒ Object
Returns the value of attribute votes.
Attributes inherited from Candidates
Instance Method Summary collapse
-
#initialize(misspelled, solution, id, votes = 0.0) ⇒ Candidate
constructor
A new instance of Candidate.
Methods inherited from Candidates
#add, #has_id?, #prune, #remove, #size, #sort_by_rank, #to_s, #total_votes, #vote_for
Constructor Details
#initialize(misspelled, solution, id, votes = 0.0) ⇒ Candidate
Returns a new instance of Candidate.
70 71 72 73 74 75 76 |
# File 'lib/my_segments/candidates.rb', line 70 def initialize(misspelled, solution, id, votes = 0.0) @misspelled = misspelled @solution = solution @id = id @votes = votes self end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
68 69 70 |
# File 'lib/my_segments/candidates.rb', line 68 def id @id end |
#misspelled ⇒ Object
Returns the value of attribute misspelled.
68 69 70 |
# File 'lib/my_segments/candidates.rb', line 68 def misspelled @misspelled end |
#solution ⇒ Object
Returns the value of attribute solution.
68 69 70 |
# File 'lib/my_segments/candidates.rb', line 68 def solution @solution end |
#votes ⇒ Object
Returns the value of attribute votes.
68 69 70 |
# File 'lib/my_segments/candidates.rb', line 68 def votes @votes end |