Class: Mohawk::Accessors::TreeView
- Inherits:
-
Object
- Object
- Mohawk::Accessors::TreeView
- Defined in:
- lib/mohawk/accessors/tree_view.rb
Instance Attribute Summary collapse
-
#view ⇒ Object
readonly
Returns the value of attribute view.
Instance Method Summary collapse
- #collapse(which_item) ⇒ Object
- #expand(which_item) ⇒ Object
-
#initialize(adapter, locator) ⇒ TreeView
constructor
A new instance of TreeView.
- #items ⇒ Object
- #select(which_item) ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(adapter, locator) ⇒ TreeView
Returns a new instance of TreeView.
6 7 8 |
# File 'lib/mohawk/accessors/tree_view.rb', line 6 def initialize(adapter, locator) @view = adapter.window.select_list(locator) end |
Instance Attribute Details
#view ⇒ Object (readonly)
Returns the value of attribute view.
4 5 6 |
# File 'lib/mohawk/accessors/tree_view.rb', line 4 def view @view end |
Instance Method Details
#collapse(which_item) ⇒ Object
22 23 24 |
# File 'lib/mohawk/accessors/tree_view.rb', line 22 def collapse(which_item) @view.collapse which_item end |
#expand(which_item) ⇒ Object
18 19 20 |
# File 'lib/mohawk/accessors/tree_view.rb', line 18 def (which_item) @view. which_item end |
#items ⇒ Object
14 15 16 |
# File 'lib/mohawk/accessors/tree_view.rb', line 14 def items @view..map &:text end |
#select(which_item) ⇒ Object
26 27 28 29 |
# File 'lib/mohawk/accessors/tree_view.rb', line 26 def select(which_item) @view.select which_item if which_item.is_a? Integer @view.set which_item if which_item.is_a? String end |
#value ⇒ Object
10 11 12 |
# File 'lib/mohawk/accessors/tree_view.rb', line 10 def value @view.value end |