Module: Taka::DOM::HTML::OptionElement
- Includes:
- FieldSetElement
- Defined in:
- lib/taka/dom/html/option_element.rb
Instance Attribute Summary collapse
-
#defaultSelected ⇒ Object
Returns the value of attribute defaultSelected.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from FieldSetElement
Instance Attribute Details
#defaultSelected ⇒ Object
Returns the value of attribute defaultSelected.
7 8 9 |
# File 'lib/taka/dom/html/option_element.rb', line 7 def defaultSelected @defaultSelected end |
Class Method Details
.extended(option) ⇒ Object
10 11 12 |
# File 'lib/taka/dom/html/option_element.rb', line 10 def extended option option.defaultSelected = !!option['selected'] end |
Instance Method Details
#index ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/taka/dom/html/option_element.rb', line 19 def index select = parent while select.node_name != 'select' select = select.parent end select..each_with_index { |o,i| return i if o == self } end |
#selected ⇒ Object
15 16 17 |
# File 'lib/taka/dom/html/option_element.rb', line 15 def selected !!self['selected'] end |