Class: Discordrb::Poll::Result
- Inherits:
-
Object
- Object
- Discordrb::Poll::Result
- Defined in:
- lib/discordrb/data/poll.rb
Overview
Finalised results for a poll.
Instance Attribute Summary collapse
-
#message_id ⇒ Integer
readonly
The ID of the message the poll result is for.
-
#question ⇒ Media
readonly
The display-data for the question of the poll.
-
#total_votes ⇒ Integer
readonly
The total amount of votes that the poll received.
-
#winner ⇒ Answer?
(also: #answer)
readonly
The answer that won the poll, if any.
Instance Method Summary collapse
-
#==(other) ⇒ true, false
(also: #eql?)
Check if two result objects are equivalent.
Instance Attribute Details
#message_id ⇒ Integer (readonly)
Returns the ID of the message the poll result is for.
276 277 278 |
# File 'lib/discordrb/data/poll.rb', line 276 def @message_id end |
#question ⇒ Media (readonly)
Returns the display-data for the question of the poll.
273 274 275 |
# File 'lib/discordrb/data/poll.rb', line 273 def question @question end |
#total_votes ⇒ Integer (readonly)
Returns the total amount of votes that the poll received.
279 280 281 |
# File 'lib/discordrb/data/poll.rb', line 279 def total_votes @total_votes end |
#winner ⇒ Answer? (readonly) Also known as: answer
Returns the answer that won the poll, if any.
269 270 271 |
# File 'lib/discordrb/data/poll.rb', line 269 def winner @winner end |
Instance Method Details
#==(other) ⇒ true, false Also known as: eql?
Check if two result objects are equivalent.
314 315 316 |
# File 'lib/discordrb/data/poll.rb', line 314 def ==(other) other.is_a?(Result) ? @message_id == other. : false end |