Class: Pupa::Vote
- Inherits:
-
Object
- Object
- Pupa::Vote
- Includes:
- Concerns::Sourceable, Concerns::Timestamps, Model
- Defined in:
- lib/pupa/models/vote.rb
Overview
A voter's vote in a vote event.
Instance Attribute Summary collapse
-
#group_id ⇒ Object
Returns the value of attribute group_id.
-
#option ⇒ Object
Returns the value of attribute option.
-
#pair_id ⇒ Object
Returns the value of attribute pair_id.
-
#role ⇒ Object
Returns the value of attribute role.
-
#vote_event_id ⇒ Object
Returns the value of attribute vote_event_id.
-
#voter_id ⇒ Object
Returns the value of attribute voter_id.
-
#weight ⇒ Object
Returns the value of attribute weight.
Instance Method Summary collapse
-
#to_s ⇒ String
Returns the vote's option, voter ID and vote event ID.
Methods included from Concerns::Sourceable
#add_source, #initialize, #sources=
Methods included from Model
#==, #[], #[]=, #_id=, #add_extra, append_features, #extras=, #fingerprint, #foreign_properties, #initialize, #to_h, #validate!
Instance Attribute Details
#group_id ⇒ Object
Returns the value of attribute group_id.
11 12 13 |
# File 'lib/pupa/models/vote.rb', line 11 def group_id @group_id end |
#option ⇒ Object
Returns the value of attribute option.
11 12 13 |
# File 'lib/pupa/models/vote.rb', line 11 def option @option end |
#pair_id ⇒ Object
Returns the value of attribute pair_id.
11 12 13 |
# File 'lib/pupa/models/vote.rb', line 11 def pair_id @pair_id end |
#role ⇒ Object
Returns the value of attribute role.
11 12 13 |
# File 'lib/pupa/models/vote.rb', line 11 def role @role end |
#vote_event_id ⇒ Object
Returns the value of attribute vote_event_id.
11 12 13 |
# File 'lib/pupa/models/vote.rb', line 11 def vote_event_id @vote_event_id end |
#voter_id ⇒ Object
Returns the value of attribute voter_id.
11 12 13 |
# File 'lib/pupa/models/vote.rb', line 11 def voter_id @voter_id end |
#weight ⇒ Object
Returns the value of attribute weight.
11 12 13 |
# File 'lib/pupa/models/vote.rb', line 11 def weight @weight end |
Instance Method Details
#to_s ⇒ String
Returns the vote's option, voter ID and vote event ID.
19 20 21 |
# File 'lib/pupa/models/vote.rb', line 19 def to_s "#{option} by #{voter_id} in #{vote_event_id}" end |