Class: Groonga::ColumnExpressionBuilder

Inherits:
Object
  • Object
show all
Includes:
ExpressionBuildable
Defined in:
lib/groonga/expression-builder.rb,
lib/groonga/expression-builder-19.rb

Constant Summary

Constants included from ExpressionBuildable

ExpressionBuildable::VALID_COLUMN_NAME_RE

Instance Attribute Summary

Attributes included from ExpressionBuildable

#allow_column, #allow_leading_not, #allow_pragma, #allow_update, #default_column, #query, #syntax, #table

Instance Method Summary collapse

Methods included from ExpressionBuildable

#&, #build, #|

Constructor Details

#initialize(column, name, query, options = {}) ⇒ ColumnExpressionBuilder

Returns a new instance of ColumnExpressionBuilder.



558
559
560
561
562
563
564
565
566
# File 'lib/groonga/expression-builder.rb', line 558

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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object (private)



632
633
634
635
636
637
638
639
640
# File 'lib/groonga/expression-builder.rb', line 632

def method_missing(name, *args, &block)
  return super if block
  return super unless args.empty?
  if VALID_COLUMN_NAME_RE =~ name.to_s
    column_expression_builder.send(name)
  else
    super
  end
end

Instance Method Details

#!=(other) ⇒ Object



36
37
38
# File 'lib/groonga/expression-builder-19.rb', line 36

def !=(other)
  column_value_builder != other
end

#%(other) ⇒ Object



608
609
610
# File 'lib/groonga/expression-builder.rb', line 608

def %(other)
  column_expression_builder % other
end

#*(other) ⇒ Object



600
601
602
# File 'lib/groonga/expression-builder.rb', line 600

def *(other)
  column_expression_builder * other
end

#+(other) ⇒ Object



592
593
594
# File 'lib/groonga/expression-builder.rb', line 592

def +(other)
  column_expression_builder + other
end

#-(other) ⇒ Object



596
597
598
# File 'lib/groonga/expression-builder.rb', line 596

def -(other)
  column_expression_builder - other
end

#/(other) ⇒ Object



604
605
606
# File 'lib/groonga/expression-builder.rb', line 604

def /(other)
  column_expression_builder / other
end

#<(other) ⇒ Object



576
577
578
# File 'lib/groonga/expression-builder.rb', line 576

def <(other)
  column_expression_builder < other
end

#<=(other) ⇒ Object



580
581
582
# File 'lib/groonga/expression-builder.rb', line 580

def <=(other)
  column_expression_builder <= other
end

#==(other) ⇒ Object



568
569
570
# File 'lib/groonga/expression-builder.rb', line 568

def ==(other)
  column_expression_builder == other
end

#=~(other) ⇒ Object



572
573
574
# File 'lib/groonga/expression-builder.rb', line 572

def =~(other)
  column_expression_builder =~ other
end

#>(other) ⇒ Object



584
585
586
# File 'lib/groonga/expression-builder.rb', line 584

def >(other)
  column_expression_builder > other
end

#>=(other) ⇒ Object



588
589
590
# File 'lib/groonga/expression-builder.rb', line 588

def >=(other)
  column_expression_builder >= other
end

#match(query, options = {}, &block) ⇒ Object



612
613
614
# File 'lib/groonga/expression-builder.rb', line 612

def match(query, options={}, &block)
  column_expression_builder.match(query, options, &block)
end

#similar_search(text) ⇒ Object



616
617
618
# File 'lib/groonga/expression-builder.rb', line 616

def similar_search(text)
  column_expression_builder.similar_search(text)
end

#term_extract(text) ⇒ Object



620
621
622
# File 'lib/groonga/expression-builder.rb', line 620

def term_extract(text)
  column_expression_builder.term_extract(text)
end