class Druid::Elements::SelectList

Public Instance Methods

[](idx) click to toggle source
# File lib/druid/elements/select_list.rb, line 5
def [](idx)
  options[idx]
end
options() click to toggle source
# File lib/druid/elements/select_list.rb, line 9
def options
  element.options.map { |e| Druid::Elements::Option.new(e)}
end
selected_options() click to toggle source

@return [Array<String>] An array of strings representing the text of the currently selected options.

# File lib/druid/elements/select_list.rb, line 16
def selected_options
  element.selected_options.map(&:text).compact
end
selected_values() click to toggle source

@return [Array<String>] An array of strings representing the value of the currently selected options.

# File lib/druid/elements/select_list.rb, line 22
def selected_values
  element.selected_options.map(&:value).compact
end