Module: Babl::Operators::Enter::DSL

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

Instance Method Summary collapse

Instance Method Details

#_Object

Simple convenience alias



18
19
20
# File 'lib/babl/operators/enter.rb', line 18

def _
    enter
end

#enterObject

Navigate to a named property of current element. The name is inferred based on the object()



9
10
11
12
13
14
15
# File 'lib/babl/operators/enter.rb', line 9

def enter
    construct_node(key: nil, continue: nil) { |node, context|
        key = context[:key]
        raise Errors::InvalidTemplate, "No key to enter into" unless key
        Nodes::Nav.new(key, node)
    }
end