Class: Discordrb::Poll::Media

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/data/poll.rb

Overview

Represents display-data for a poll.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#emojiEmoji? (readonly)

Returns the emoji of the poll media.

Returns:

  • (Emoji, nil)

    the emoji of the poll media.



235
236
237
# File 'lib/discordrb/data/poll.rb', line 235

def emoji
  @emoji
end

#textString? (readonly)

Returns the text of the poll media.

Returns:

  • (String, nil)

    the text of the poll media.



232
233
234
# File 'lib/discordrb/data/poll.rb', line 232

def text
  @text
end

Instance Method Details

#==(other) ⇒ true, false Also known as: eql?

Check if two poll media objects are equivalent.

Parameters:

  • other (Object)

    The object to compare the poll media against.

Returns:

  • (true, false)

    Whether or not the poll media objects are equivalent.



247
248
249
250
251
# File 'lib/discordrb/data/poll.rb', line 247

def ==(other)
  return false unless other.is_a?(Media)

  @text == other.text && @emoji == other.emoji
end