Module: Babl::Operators::Pin::DSL

Included in:
Template
Defined in:
lib/babl/operators/pin.rb

Instance Method Summary collapse

Instance Method Details

#pin(navigation = nil, &block) ⇒ Object

Create a pin



6
7
8
9
10
11
# File 'lib/babl/operators/pin.rb', line 6

def pin(navigation = nil, &block)
    return pin { |p| block[p.call(navigation)] } if navigation
    ref = ::Object.new
    referenced_scope = unscoped.construct_node(key: nil, continue: nil) { |node| GotoPinNode.new(node, ref) }
    construct_node(continue: nil) { |node| CreatePinNode.new(node, ref) }.call(block[referenced_scope])
end