Module: CloudSesame::Query::DSL::LiteralChainingMethods

Included in:
AST::MultiExpressionOperatorChildren
Defined in:
lib/cloud_sesame/query/dsl/literal_chaining_methods.rb

Instance Method Summary collapse

Instance Method Details

#insert(values = []) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/cloud_sesame/query/dsl/literal_chaining_methods.rb', line 34

def insert(values = [])
	values.each do |value|
		_scope << create_parents(build_literal(value))
	end
	parents.clear unless values.empty?
  _return != _scope ? _return : self
end

#near(*values) ⇒ Object Also known as: sloppy

NEAR



17
18
19
20
# File 'lib/cloud_sesame/query/dsl/literal_chaining_methods.rb', line 17

def near(*values)
	parents[0] = { klass: AST::Near, options: extract_options(values) }
  insert values
end

#not(*values) ⇒ Object Also known as: is_not

NOT



8
9
10
11
# File 'lib/cloud_sesame/query/dsl/literal_chaining_methods.rb', line 8

def not(*values)
	parents[1] = { klass: AST::Not, options: extract_options(values) }
  insert values
end

#prefix(*values) ⇒ Object Also known as: start_with, begin_with

PREFIX



26
27
28
29
# File 'lib/cloud_sesame/query/dsl/literal_chaining_methods.rb', line 26

def prefix(*values)
  parents[0] = { klass: AST::Prefix, options: extract_options(values) }
  insert values
end