Sha256: f2e0a7f8ba6614ae7165e75bde49f46918a09869611c8c67301ac73fb5a4ecd1

Contents?: true

Size: 639 Bytes

Versions: 7

Compression:

Stored size: 639 Bytes

Contents

module Mohawk
  module Accessors
    class TreeView
      attr_reader :view

      def initialize(adapter, locator)
        @view = adapter.window.select_list(locator)
      end

      def value
        @view.value
      end

      def items
        @view.options.map &:text
      end

      def expand(which_item)
        @view.expand which_item
      end

      def collapse(which_item)
        @view.collapse which_item
      end

      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
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mohawk-0.0.9 lib/mohawk/accessors/tree_view.rb
mohawk-0.0.8 lib/mohawk/accessors/tree_view.rb
mohawk-0.0.7 lib/mohawk/accessors/tree_view.rb
mohawk-0.0.6 lib/mohawk/accessors/tree_view.rb
mohawk-0.0.5 lib/mohawk/accessors/tree_view.rb
mohawk-0.0.4 lib/mohawk/accessors/tree_view.rb
mohawk-0.0.3 lib/mohawk/accessors/tree_view.rb