Module: AtspiAccessiblePatches

Defined in:
lib/atspi_app_driver.rb

Overview

Utility monkey-patches for the Atspi::Accessible class

Instance Method Summary collapse

Instance Method Details

#each_childObject



10
11
12
13
14
15
# File 'lib/atspi_app_driver.rb', line 10

def each_child
  child_count.times do |i|
    child = get_child_at_index i
    yield child if child
  end
end

#find_role(role, regex = //) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/atspi_app_driver.rb', line 17

def find_role(role, regex = //)
  return self if role == self.role && name =~ regex

  each_child do |child|
    result = child.find_role role, regex
    return result if result
  end
  nil
end

#inspect_recursive(level = 0, maxlevel = 5) ⇒ Object



27
28
29
30
31
32
# File 'lib/atspi_app_driver.rb', line 27

def inspect_recursive(level = 0, maxlevel = 5)
  puts "#{"  " * level} > name: #{name}; role: #{role}"
  each_child do |child|
    child.inspect_recursive(level + 1) unless level >= maxlevel
  end
end