Module: ComponentSearch

Defined in:
lib/fumoffu/generators/templates/src/ruby/app/utils/component_search.rb

Overview

To change this template, choose Tools | Templates and open the template in the editor.

Instance Method Summary collapse

Instance Method Details

#component_by_name(component, target) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/fumoffu/generators/templates/src/ruby/app/utils/component_search.rb', line 5

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) ⇒ Object



16
17
18
19
20
21
# File 'lib/fumoffu/generators/templates/src/ruby/app/utils/component_search.rb', line 16

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