Class: LessForm::Select
Instance Attribute Summary
Attributes inherited from Element
#element
Instance Method Summary
collapse
Methods inherited from Element
#click, #displayed?, #flash, #method_missing, #set, #text, #valid_element?
Constructor Details
#initialize(element) ⇒ Select
Returns a new instance of Select.
3
4
5
6
|
# File 'lib/less-form/select.rb', line 3
def initialize element
super
@options = Options.new(element)
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class LessForm::Element
Instance Method Details
#options ⇒ Object
8
9
10
|
# File 'lib/less-form/select.rb', line 8
def options
@options.all
end
|
#select(text) ⇒ Object
20
21
22
|
# File 'lib/less-form/select.rb', line 20
def select text
select_by_text text
end
|
#select_by_text(text) ⇒ Object
16
17
18
|
# File 'lib/less-form/select.rb', line 16
def select_by_text text
@options.by_text(text).click
end
|
#select_by_value(value) ⇒ Object
12
13
14
|
# File 'lib/less-form/select.rb', line 12
def select_by_value(value)
@options.by_value(value).click
end
|
#selected ⇒ Object
24
25
26
|
# File 'lib/less-form/select.rb', line 24
def selected
@options.selected
end
|