class Eggshell::Bundles::Basic::ControlLoopMacros::WhileLoopWrapper
Public Class Methods
new(eggshell, cond)
click to toggle source
# File lib/eggshell/bundles/basics.rb, line 782 def initialize(eggshell, cond) @eggshell = eggshell @cond = cond end
Public Instance Methods
each() { |counter| ... }
click to toggle source
# File lib/eggshell/bundles/basics.rb, line 787 def each(&block) counter = 0 struct = Eggshell::ExpressionEvaluator.struct(@cond) cond = @eggshell.expr_eval(struct) while cond yield(counter) counter += 1 cond = @eggshell.expr_eval(struct) end end