Class: Groonga::ColumnExpressionBuilder
- Inherits:
-
Object
- Object
- Groonga::ColumnExpressionBuilder
show all
- Includes:
- ExpressionBuildable
- Defined in:
- lib/groonga/expression-builder.rb
Overview
Instance Attribute Summary
#allow_column, #allow_pragma, #allow_update, #default_column, #query, #syntax, #table
Instance Method Summary
collapse
#&, #build, #|
Constructor Details
#initialize(column, name, query, options = {}) ⇒ ColumnExpressionBuilder
Returns a new instance of ColumnExpressionBuilder.
231
232
233
234
235
236
237
238
239
|
# File 'lib/groonga/expression-builder.rb', line 231
def initialize(column, name, query, options={})
super()
@table = options[:table] || column.table
@default_column = column
@column_name = options[:column_name] || @default_column.local_name
@range = @default_column.range
@name = name
@query = query
end
|
Instance Method Details
253
254
255
|
# File 'lib/groonga/expression-builder.rb', line 253
def <(other)
LessExpressionBuilder.new(@default_column, normalize(other))
end
|
#==(other) ⇒ Object
241
242
243
|
# File 'lib/groonga/expression-builder.rb', line 241
def ==(other)
EqualExpressionBuilder.new(@default_column, normalize(other))
end
|
#=~(other) ⇒ Object
245
246
247
248
249
250
251
|
# File 'lib/groonga/expression-builder.rb', line 245
def =~(other)
if other.nil?
full_column_name = "#{@table.name}.#{@column_name}"
raise ArgumentError, "match word should not be nil: #{full_column_name}"
end
MatchExpressionBuilder.new(@default_column, normalize(other))
end
|
261
262
263
|
# File 'lib/groonga/expression-builder.rb', line 261
def >(other)
GreaterExpressionBuilder.new(@default_column, normalize(other))
end
|
#match(query, options = {}) ⇒ Object
269
270
271
272
273
274
|
# File 'lib/groonga/expression-builder.rb', line 269
def match(query, options={})
options = options.dup
options[:syntax] ||= :query
options[:default_column] = @column_name
SubExpressionBuilder.new(query, options)
end
|