Class: Prequel::Expressions::Equal

Inherits:
Object
  • Object
show all
Defined in:
lib/prequel/expressions/equal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(left, right) ⇒ Equal

Returns a new instance of Equal.



5
6
7
# File 'lib/prequel/expressions/equal.rb', line 5

def initialize(left, right)
  @left, @right = left, right
end

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



4
5
6
# File 'lib/prequel/expressions/equal.rb', line 4

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



4
5
6
# File 'lib/prequel/expressions/equal.rb', line 4

def right
  @right
end

Instance Method Details

#resolve_in_query(query) ⇒ Object



13
14
15
# File 'lib/prequel/expressions/equal.rb', line 13

def resolve_in_query(query)
  Equal.new(left.resolve_in_query(query), right.resolve_in_query(query))
end

#resolve_in_relations(relations) ⇒ Object



9
10
11
# File 'lib/prequel/expressions/equal.rb', line 9

def resolve_in_relations(relations)
  Equal.new(left.resolve_in_relations(relations), right.resolve_in_relations(relations))
end

#to_sqlObject



17
18
19
# File 'lib/prequel/expressions/equal.rb', line 17

def to_sql
  "#{left.to_sql} = #{right.to_sql}"
end