Class: Prequel::Expressions::Equal
- Inherits:
-
Object
- Object
- Prequel::Expressions::Equal
- Defined in:
- lib/prequel/expressions/equal.rb
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Instance Method Summary collapse
-
#initialize(left, right) ⇒ Equal
constructor
A new instance of Equal.
- #resolve_in_query(query) ⇒ Object
- #resolve_in_relations(relations) ⇒ Object
- #to_sql ⇒ Object
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
#left ⇒ Object (readonly)
Returns the value of attribute left.
4 5 6 |
# File 'lib/prequel/expressions/equal.rb', line 4 def left @left end |
#right ⇒ Object (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_sql ⇒ Object
17 18 19 |
# File 'lib/prequel/expressions/equal.rb', line 17 def to_sql "#{left.to_sql} = #{right.to_sql}" end |