Class: CloudSesame::Query::AST::Abstract::Operator

Inherits:
Object
  • Object
show all
Defined in:
lib/cloud_sesame/query/ast/abstract/operator.rb

Constant Summary collapse

SYMBOL =
nil

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context, options = {}) ⇒ Operator

Returns a new instance of Operator.



10
11
12
13
# File 'lib/cloud_sesame/query/ast/abstract/operator.rb', line 10

def initialize(context, options = {})
  @context = context
  @options = options
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



8
9
10
# File 'lib/cloud_sesame/query/ast/abstract/operator.rb', line 8

def context
  @context
end

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/cloud_sesame/query/ast/abstract/operator.rb', line 8

def options
  @options
end

Instance Method Details

#boostObject



15
16
17
# File 'lib/cloud_sesame/query/ast/abstract/operator.rb', line 15

def boost
  " boost=#{ options[:boost] }" if options[:boost]
end

#symbolObject



19
20
21
# File 'lib/cloud_sesame/query/ast/abstract/operator.rb', line 19

def symbol
  self.class::SYMBOL
end