Class: Clack::Core::Option

Inherits:
Data
  • Object
show all
Defined in:
lib/clack/core/options_helper.rb

Overview

Value object for normalized select-style options.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#disabledObject (readonly)

Returns the value of attribute disabled

Returns:

  • (Object)

    the current value of disabled



6
7
8
# File 'lib/clack/core/options_helper.rb', line 6

def disabled
  @disabled
end

#hintObject (readonly)

Returns the value of attribute hint

Returns:

  • (Object)

    the current value of hint



6
7
8
# File 'lib/clack/core/options_helper.rb', line 6

def hint
  @hint
end

#labelObject (readonly)

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



6
7
8
# File 'lib/clack/core/options_helper.rb', line 6

def label
  @label
end

#valueObject (readonly)

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



6
7
8
# File 'lib/clack/core/options_helper.rb', line 6

def value
  @value
end

Instance Method Details

#[](key) ⇒ Object

Hash-style read access for backward compatibility with code (e.g. custom autocomplete filters) written against the old option hashes.



11
# File 'lib/clack/core/options_helper.rb', line 11

def [](key) = to_h[key]

#to_sObject



7
# File 'lib/clack/core/options_helper.rb', line 7

def to_s = label.to_s