Skip to content

Commit

Permalink
extract method
Browse files Browse the repository at this point in the history
  • Loading branch information
garybernhardt committed Jan 1, 2011
1 parent e77afc5 commit 575c1fb
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions progress_bar_finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,7 @@ def indicators
end

def indicators_from_element(element)
immediate_indicators = self.immediate_indicators(element)
children = element.scrollAreas.get()
if children.empty?
child_indicators = []
else
child_indicators = children.map do |child|
indicators_from_element(child)
end
end

immediate_indicators + child_indicators
immediate_indicators(element) + indicators_from_children(element)
end

def immediate_indicators(element)
Expand All @@ -71,6 +61,17 @@ def immediate_indicators(element)
end
end

def indicators_from_children(element)
children = element.scrollAreas.get()
if children.empty?
[]
else
children.map do |child|
indicators_from_element(child)
end
end
end

def percent_for_indicator(indicator)
attributes = indicator.attributes.get
value = get_attribute(attributes, 'AXValue')
Expand Down

0 comments on commit 575c1fb

Please sign in to comment.