module Fumoffu::Utils::ComponentSearch

Public Instance Methods

component_by_name(component, target) click to toggle source
# File lib/fumoffu/utils/component_search.rb, line 4
def component_by_name component, target
  name = component.getName
  return component unless name.nil? or name != target
    
  if component.getParent then
    component_by_name(component.getParent, target)
  else
    return nil
  end
end
component_child_by_name(component, target) click to toggle source
# File lib/fumoffu/utils/component_search.rb, line 15
def component_child_by_name component, target
  component.getComponents.each do |child_component|
    return child_component unless child_component.getName != target
  end
  return nil
end