module Babl::Operators::Continue::DSL

Public Instance Methods

continue() click to toggle source

Return a special placeholder that can be used as a switch(…) value. It tells BABL to continue the evaluation of the original chain after switch().

# File lib/babl/operators/continue.rb, line 10
def continue
    construct_terminal { |context|
        node = context[:continue]
        raise Errors::InvalidTemplate, 'continue() cannot be used outside switch()' unless node

        node
    }
end

Protected Instance Methods

reset_continue() click to toggle source

Clear contextual information about parent switch for the rest of the chain

# File lib/babl/operators/continue.rb, line 22
def reset_continue
    construct_context { |context|
        next context unless context.key?(:continue)

        context.reject { |k, _v| :continue == k }
    }
end