Sha256: 18f768643497d4003dfa43a2dad8a78b24c910f7c207df0488a35480a5a9c920

Contents?: true

Size: 1.07 KB

Versions: 11

Compression:

Stored size: 1.07 KB

Contents

module CloudSesame
	module Query
		module Domain
			class Block
				extend ClassSpecific
				include DSL::AppliedFilterQuery
				include DSL::BlockStyledOperators
        include DSL::Operators
        include DSL::RangeHelper
        include DSL::ScopeAccessors
        include DSL::BindCaller

        after_construct { |_, field_accessor| include field_accessor }

				attr_reader :_caller, :_context, :_scopes

				def initialize(_caller, _context)
					self._caller = _caller
					@_context = _context
					@_scopes = []
				end

				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

				def _scope
					_scopes[-1]
				end

				def _return
					_scope
				end

				def _block_domain(_block)
					self
				end

			end
		end
	end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
CloudSesame-0.8.3 lib/cloud_sesame/query/domain/block.rb
CloudSesame-0.8.2 lib/cloud_sesame/query/domain/block.rb
CloudSesame-0.8.1 lib/cloud_sesame/query/domain/block.rb
CloudSesame-0.8.0 lib/cloud_sesame/query/domain/block.rb
CloudSesame-0.7.13 lib/cloud_sesame/query/domain/block.rb
CloudSesame-0.7.12 lib/cloud_sesame/query/domain/block.rb
CloudSesame-0.7.11 lib/cloud_sesame/query/domain/block.rb
CloudSesame-0.7.10 lib/cloud_sesame/query/domain/block.rb
CloudSesame-0.7.9 lib/cloud_sesame/query/domain/block.rb
CloudSesame-0.7.8 lib/cloud_sesame/query/domain/block.rb
CloudSesame-0.7.7 lib/cloud_sesame/query/domain/block.rb