Module: Groonga::ExpressionBuildable

Included in:
ColumnExpressionBuilder, RecordExpressionBuilder
Defined in:
lib/groonga/expression-builder.rb

Defined Under Namespace

Classes: AndExpressionBuilder, AndNotExpressionBuilder, BinaryExpressionBuilder, CallExpressionBuilder, ColumnValueExpressionBuilder, EqualExpressionBuilder, ExpressionBuilder, GreaterEqualExpressionBuilder, GreaterExpressionBuilder, LessEqualExpressionBuilder, LessExpressionBuilder, MatchExpressionBuilder, MatchTargetColumnExpressionBuilder, MatchTargetExpressionBuilder, MinusExpressionBuilder, ModExpressionBuilder, NotEqualExpressionBuilder, OrExpressionBuilder, PlusExpressionBuilder, PrefixSearchExpressionBuilder, RegexpExpressionBuilder, SetExpressionBuilder, SimilarSearchExpressionBuilder, SlashExpressionBuilder, StarExpressionBuilder, SubExpressionBuilder, SuffixSearchExpressionBuilder, TermExtractExpressionBuilder

Constant Summary collapse

VALID_COLUMN_NAME_RE =
/\A[a-zA-Z\d_]+\z/

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#allow_columnObject

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_leading_notObject

Returns the value of attribute allow_leading_not.



26
27
28
# File 'lib/groonga/expression-builder.rb', line 26

def allow_leading_not
  @allow_leading_not
end

#allow_pragmaObject

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_updateObject

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_columnObject

Returns the value of attribute default_column.



27
28
29
# File 'lib/groonga/expression-builder.rb', line 27

def default_column
  @default_column
end

#queryObject

Returns the value of attribute query.



21
22
23
# File 'lib/groonga/expression-builder.rb', line 21

def query
  @query
end

#syntaxObject

Returns the value of attribute syntax.



22
23
24
# File 'lib/groonga/expression-builder.rb', line 22

def syntax
  @syntax
end

#tableObject (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



49
50
51
# File 'lib/groonga/expression-builder.rb', line 49

def &(other)
  other
end

#-(other) ⇒ Object



57
58
59
# File 'lib/groonga/expression-builder.rb', line 57

def -(other)
  other
end

#build(&block) ⇒ Object



43
44
45
46
47
# File 'lib/groonga/expression-builder.rb', line 43

def build(&block)
  expression = Expression.new(:name => @name, :context => @table.context)
  variable = expression.define_variable(:domain => @table)
  build_expression(expression, variable, &block)
end

#initializeObject



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/groonga/expression-builder.rb', line 31

def initialize
  @table = nil
  @name = nil
  @query = nil
  @syntax = nil
  @allow_pragma = nil
  @allow_column = nil
  @allow_update = nil
  @allow_leading_not = nil
  @default_column = nil
end

#|(other) ⇒ Object



53
54
55
# File 'lib/groonga/expression-builder.rb', line 53

def |(other)
  other
end