Module: Groonga::ExpressionBuildable
- Included in:
- ColumnExpressionBuilder, RecordExpressionBuilder
- Defined in:
- lib/groonga/expression-builder.rb
Overview
:nodoc:
Defined Under Namespace
Classes: AndExpressionBuilder, BinaryExpressionBuilder, EqualExpressionBuilder, ExpressionBuilder, GreaterEqualExpressionBuilder, GreaterExpressionBuilder, LessEqualExpressionBuilder, LessExpressionBuilder, MatchExpressionBuilder, OrExpressionBuilder, SetExpressionBuilder, SubExpressionBuilder
Instance Attribute Summary collapse
-
#allow_column ⇒ Object
Returns the value of attribute allow_column.
-
#allow_pragma ⇒ Object
Returns the value of attribute allow_pragma.
-
#allow_update ⇒ Object
Returns the value of attribute allow_update.
-
#default_column ⇒ Object
Returns the value of attribute default_column.
-
#query ⇒ Object
Returns the value of attribute query.
-
#syntax ⇒ Object
Returns the value of attribute syntax.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
Instance Attribute Details
#allow_column ⇒ Object
Returns the value of attribute allow_column.
24 25 26 |
# File 'lib/groonga/expression-builder.rb', line 24 def allow_column @allow_column end |
#allow_pragma ⇒ Object
Returns the value of attribute allow_pragma.
23 24 25 |
# File 'lib/groonga/expression-builder.rb', line 23 def allow_pragma @allow_pragma end |
#allow_update ⇒ Object
Returns the value of attribute allow_update.
25 26 27 |
# File 'lib/groonga/expression-builder.rb', line 25 def allow_update @allow_update end |
#default_column ⇒ Object
Returns the value of attribute default_column.
26 27 28 |
# File 'lib/groonga/expression-builder.rb', line 26 def default_column @default_column end |
#query ⇒ Object
Returns the value of attribute query.
21 22 23 |
# File 'lib/groonga/expression-builder.rb', line 21 def query @query end |
#syntax ⇒ Object
Returns the value of attribute syntax.
22 23 24 |
# File 'lib/groonga/expression-builder.rb', line 22 def syntax @syntax end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
20 21 22 |
# File 'lib/groonga/expression-builder.rb', line 20 def table @table end |
Instance Method Details
#&(other) ⇒ Object
64 65 66 |
# File 'lib/groonga/expression-builder.rb', line 64 def &(other) other end |
#build ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/groonga/expression-builder.rb', line 39 def build expression = Expression.new(:name => @name) variable = expression.define_variable(:domain => @table) builder = nil builder = match(@query, ) if @query if block_given? if builder builder &= yield(self) else builder = yield(self) end end if builder.nil? or builder == self expression.append_constant(1) expression.append_constant(1) expression.append_operation(Groonga::Operation::OR, 2) else builder.build(expression, variable) end expression.compile expression end |
#initialize(*args) ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/groonga/expression-builder.rb', line 28 def initialize(*args) @table = nil @name = nil @query = nil @syntax = nil @allow_pragma = nil @allow_column = nil @allow_update = nil @default_column = nil end |
#|(other) ⇒ Object
68 69 70 |
# File 'lib/groonga/expression-builder.rb', line 68 def |(other) other end |