Class: Yuriita::Selects::Exclusive

Inherits:
Object
  • Object
show all
Defined in:
lib/yuriita/selects/exclusive.rb

Instance Method Summary collapse

Constructor Details

#initialize(options:, default:, query:) ⇒ Exclusive

Returns a new instance of Exclusive.



4
5
6
7
8
# File 'lib/yuriita/selects/exclusive.rb', line 4

def initialize(options:, default:, query:)
  @options = options
  @default = default
  @query = query
end

Instance Method Details

#filterObject



10
11
12
# File 'lib/yuriita/selects/exclusive.rb', line 10

def filter
  active_option.filter
end

#selected?(option) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/yuriita/selects/exclusive.rb', line 14

def selected?(option)
  active_option == option
end