Class: SQLSearch::Comparison

Inherits:
Object
  • Object
show all
Defined in:
lib/sql_search_parser.rb

Direct Known Subclasses

In

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Comparison

Returns a new instance of Comparison.



45
46
47
48
49
# File 'lib/sql_search_parser.rb', line 45

def initialize options
  @left = options[:left]
  @right = options[:right]
  @operator = options[:operator]
end

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



43
44
45
# File 'lib/sql_search_parser.rb', line 43

def left
  @left
end

#operatorObject (readonly)

Returns the value of attribute operator.



43
44
45
# File 'lib/sql_search_parser.rb', line 43

def operator
  @operator
end

#rightObject (readonly)

Returns the value of attribute right.



43
44
45
# File 'lib/sql_search_parser.rb', line 43

def right
  @right
end

Instance Method Details

#to_sObject



51
52
53
# File 'lib/sql_search_parser.rb', line 51

def to_s
  "#{left} #{operator} #{right}"
end