Class: Mohawk::Accessors::Tabs
- Inherits:
-
Object
- Object
- Mohawk::Accessors::Tabs
- Defined in:
- lib/mohawk/accessors/tabs.rb
Instance Attribute Summary collapse
-
#view ⇒ Object
readonly
Returns the value of attribute view.
Instance Method Summary collapse
-
#initialize(adapter, locator) ⇒ Tabs
constructor
A new instance of Tabs.
- #items ⇒ Object
- #selected_tab=(which) ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(adapter, locator) ⇒ Tabs
Returns a new instance of Tabs.
6 7 8 |
# File 'lib/mohawk/accessors/tabs.rb', line 6 def initialize(adapter, locator) @view = adapter.window.tab_control(locator) end |
Instance Attribute Details
#view ⇒ Object (readonly)
Returns the value of attribute view.
4 5 6 |
# File 'lib/mohawk/accessors/tabs.rb', line 4 def view @view end |
Instance Method Details
#items ⇒ Object
25 26 27 |
# File 'lib/mohawk/accessors/tabs.rb', line 25 def items @view.items.map(&:text) end |
#selected_tab=(which) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mohawk/accessors/tabs.rb', line 14 def selected_tab=(which) case which when String view.set(which) when Regexp view.set items.find {|t| t.match which } else view.select(which) end end |
#value ⇒ Object
10 11 12 |
# File 'lib/mohawk/accessors/tabs.rb', line 10 def value view.value end |