Class: Webrat::SelectOption

Inherits:
Element show all
Defined in:
lib/webrat/core/elements/select_option.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Element

#element

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Element

#initialize, #inspect, load, load_all, #path

Constructor Details

This class inherits a constructor from Webrat::Element

Class Method Details

.xpath_searchObject



6
7
8
# File 'lib/webrat/core/elements/select_option.rb', line 6

def self.xpath_search
  [".//option"]
end

Instance Method Details

#chooseObject



10
11
12
13
# File 'lib/webrat/core/elements/select_option.rb', line 10

def choose
  select.raise_error_if_disabled
  select.set(value)
end

#inner_textObject



20
21
22
# File 'lib/webrat/core/elements/select_option.rb', line 20

def inner_text
  @element.inner_text
end

#unchooseObject



15
16
17
18
# File 'lib/webrat/core/elements/select_option.rb', line 15

def unchoose
  select.raise_error_if_disabled
  select.unset(value)
end