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

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

Instance Method Summary collapse

Instance Method Details

#goto_pin(ref) ⇒ Object



21
22
23
24
# File 'lib/babl/operators/pin.rb', line 21

def goto_pin(ref)
    check_pin_ref(ref)
    construct_node(key: nil, continue: nil) { |node| Nodes::GotoPin.new(node, ref) }
end

#named_pin(ref) ⇒ Object



16
17
18
19
# File 'lib/babl/operators/pin.rb', line 16

def named_pin(ref)
    check_pin_ref(ref)
    construct_node(continue: nil) { |node| Nodes::CreatePin.new(node, ref) }
end

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

Create a pin



11
12
13
14
# File 'lib/babl/operators/pin.rb', line 11

def pin(navigation = unscoped, &block)
    ref = Utils::Ref.new
    named_pin(ref).call(block[unscoped.goto_pin(ref).call(navigation)])
end