Class: Discordrb::Components::SelectMenu::Option

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

Overview

A select menu option.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Option

Returns a new instance of Option.



128
129
130
131
132
133
# File 'lib/discordrb/data/component.rb', line 128

def initialize(data)
  @label = data['label']
  @value = data['value']
  @description = data['description']
  @emoji = Emoji.new(data['emoji'], @bot) if data['emoji']
end

Instance Attribute Details

#descriptionString? (readonly)

Returns:



122
123
124
# File 'lib/discordrb/data/component.rb', line 122

def description
  @description
end

#emojiEmoji? (readonly)

Returns:



125
126
127
# File 'lib/discordrb/data/component.rb', line 125

def emoji
  @emoji
end

#labelString (readonly)

Returns:



116
117
118
# File 'lib/discordrb/data/component.rb', line 116

def label
  @label
end

#valueString (readonly)

Returns:



119
120
121
# File 'lib/discordrb/data/component.rb', line 119

def value
  @value
end