class Mohawk::Adapters::UIA::Table
Public Instance Methods
[](index)
click to toggle source
# File lib/mohawk/adapters/uia/table.rb, line 24 def [](index) row_at(index) end
add(which)
click to toggle source
# File lib/mohawk/adapters/uia/table.rb, line 12 def add(which) find_row_with(which).add end
clear(which)
click to toggle source
# File lib/mohawk/adapters/uia/table.rb, line 16 def clear(which) find_row_with(which).clear end
each() { |row| ... }
click to toggle source
# File lib/mohawk/adapters/uia/table.rb, line 28 def each all_items.each { |row| yield row } end
element()
click to toggle source
Calls superclass method
Mohawk::Adapters::UIA::Control#element
# File lib/mohawk/adapters/uia/table.rb, line 43 def element super.as(:table) end
find_row_with(row_info)
click to toggle source
# File lib/mohawk/adapters/uia/table.rb, line 32 def find_row_with(row_info) found_row = case row_info when Hash find_by_hash(row_info) else find_element(row_info) end raise "A row with #{row_info} was not found" unless found_row found_row end
headers()
click to toggle source
# File lib/mohawk/adapters/uia/table.rb, line 20 def headers element.headers.map &:name end
select(which)
click to toggle source
# File lib/mohawk/adapters/uia/table.rb, line 8 def select(which) find_row_with(which).select end
Private Instance Methods
all_items()
click to toggle source
# File lib/mohawk/adapters/uia/table.rb, line 56 def all_items element.row_count.times.map { |index| TableRow.new self, index } end
find_by_hash(hash)
click to toggle source
# File lib/mohawk/adapters/uia/table.rb, line 48 def find_by_hash(hash) find { |r| r.all_match? hash } end
row_at(index)
click to toggle source
# File lib/mohawk/adapters/uia/table.rb, line 52 def row_at(index) TableRow.new self, index end