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.



136
137
138
139
140
141
# File 'lib/discordrb/data/component.rb', line 136

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:



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

def description
  @description
end

#emojiEmoji? (readonly)

Returns:



133
134
135
# File 'lib/discordrb/data/component.rb', line 133

def emoji
  @emoji
end

#labelString (readonly)

Returns:



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

def label
  @label
end

#valueString (readonly)

Returns:



127
128
129
# File 'lib/discordrb/data/component.rb', line 127

def value
  @value
end