Class: PollAnswer

Inherits:
Object
  • Object
show all
Defined in:
lib/objects/poll_answer.rb

Overview

This object represents an answer of a user in a non-anonymous poll.

Instance Method Summary collapse

Constructor Details

#initialize(poll) ⇒ PollAnswer

:nodoc:



10
11
12
# File 'lib/objects/poll_answer.rb', line 10

def initialize(poll) # :nodoc:
  @poll = poll
end

Instance Method Details

#option_idsObject

0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.



26
27
28
# File 'lib/objects/poll_answer.rb', line 26

def option_ids
  @poll.option_ids
end

#poll_idObject

Unique poll identifier.



15
16
17
# File 'lib/objects/poll_answer.rb', line 15

def poll_id
  @poll.poll_id
end

#userObject

The user, who changed the answer to the poll. Return User object



20
21
22
# File 'lib/objects/poll_answer.rb', line 20

def user
  User.new(@poll.user)
end