class CloudSesame::Query::Domain::Block

Attributes

_caller[R]
_context[R]
_scopes[R]

Public Class Methods

new(_caller, _context) click to toggle source
# File lib/cloud_sesame/query/domain/block.rb, line 18
def initialize(_caller, _context)
        self._caller = _caller
        @_context = _context
        @_scopes = []
end

Public Instance Methods

_block_domain(_block) click to toggle source
# File lib/cloud_sesame/query/domain/block.rb, line 46
def _block_domain(_block)
        self
end
_eval(node, _scope, _return = _scope, &block) click to toggle source
# File lib/cloud_sesame/query/domain/block.rb, line 24
def _eval(node, _scope, _return = _scope, &block)
        _scopes.push node

        # must build the subtree before push (<<) to it's
        # parents (_scope) in order for the parent properly
        # propagate message down to all the children.
        # ===============================================
        instance_eval(&block)
        _scope << node

        _scopes.pop
        _scope.is_a?(AST::Root) ? _return : node
end
_return() click to toggle source
# File lib/cloud_sesame/query/domain/block.rb, line 42
def _return
        _scope
end
_scope() click to toggle source
# File lib/cloud_sesame/query/domain/block.rb, line 38
def _scope
        _scopes[-1]
end