Class: Gloo::Objs::EachChild
- Inherits:
-
Object
- Object
- Gloo::Objs::EachChild
- Defined in:
- lib/gloo/objs/ctrl/each_child.rb
Constant Summary collapse
- CHILD =
'child'.freeze
- IN =
'IN'.freeze
Class Method Summary collapse
-
.use_for?(iterator_obj) ⇒ Boolean
Use this iterator for each loop?.
Instance Method Summary collapse
-
#initialize(engine, iterator_obj) ⇒ EachChild
constructor
——————————————————————— Create Iterator ———————————————————————.
-
#run ⇒ Object
Run for each child.
-
#set_child(obj) ⇒ Object
Set the child alias.
Constructor Details
#initialize(engine, iterator_obj) ⇒ EachChild
Create Iterator
18 19 20 21 |
# File 'lib/gloo/objs/ctrl/each_child.rb', line 18 def initialize( engine, iterator_obj ) @engine = engine @iterator_obj = iterator_obj end |
Class Method Details
Instance Method Details
#run ⇒ Object
Run for each child.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/gloo/objs/ctrl/each_child.rb', line 45 def run o = @iterator_obj.find_child IN return unless o o = Gloo::Objs::Alias.resolve_alias( @engine, o ) o.children.each do |child| set_child child @iterator_obj.run_do end end |
#set_child(obj) ⇒ Object
Set the child alias.
59 60 61 62 63 64 |
# File 'lib/gloo/objs/ctrl/each_child.rb', line 59 def set_child( obj ) o = @iterator_obj.find_child CHILD return unless o o.set_value obj.pn end |