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



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

def _
    enter
end

#enterObject

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



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

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