Class: Turntabler::Vote
Overview
Represents a vote that was made within a room
Instance Attribute Summary collapse
-
#direction ⇒ Symbol
readonly
Whether the user voted
:upor:down. -
#user ⇒ Turntabler::User
readonly
The user who cast the vote.
Attributes inherited from Resource
Method Summary
Methods inherited from Resource
#==, attribute, #attributes=, #hash, #initialize, #load, #loaded?, #pretty_print, #pretty_print_instance_variables
Methods included from Assertions
#assert_valid_keys, #assert_valid_values
Methods included from DigestHelpers
Constructor Details
This class inherits a constructor from Turntabler::Resource
Instance Attribute Details
#direction ⇒ Symbol (readonly)
Whether the user voted :up or :down
15 16 17 |
# File 'lib/turntabler/vote.rb', line 15 attribute :direction do |value| value.to_sym end |
#user ⇒ Turntabler::User (readonly)
The user who cast the vote
9 10 11 |
# File 'lib/turntabler/vote.rb', line 9 attribute :user, :userid do |value| room? ? room.build_user(:_id => value) : User.new(client, :_id => value) end |