Class: Ronin::Code::SQL::BinaryExpr
- Inherits:
-
Object
- Object
- Ronin::Code::SQL::BinaryExpr
- Defined in:
- lib/ronin/code/sql/binary_expr.rb
Overview
Represents a binary expression in SQL.
Instance Attribute Summary collapse
-
#left ⇒ Statement, ...
readonly
The left-hand side of the binary expression.
-
#operator ⇒ Symbol
readonly
The binary expression's operator.
-
#right ⇒ Object
readonly
The right-hand side of the binary expression.
Instance Method Summary collapse
-
#initialize(left, operator, right) ⇒ BinaryExpr
constructor
Initializes the binary expression.
-
#to_sql(**kwargs) ⇒ String
Converts the binary expression to SQL.
Methods included from Emittable
Methods included from Operators
#!, #!=, #%, #&, #*, #+, #+@, #-, #-@, #/, #<, #<<, #<=, #==, #>, #>=, #>>, #and, #as, #glob, #in, #is, #is_not, #like, #match, #not, #or, #regexp, #|, #~
Constructor Details
#initialize(left, operator, right) ⇒ BinaryExpr
Initializes the binary expression.
64 65 66 67 68 |
# File 'lib/ronin/code/sql/binary_expr.rb', line 64 def initialize(left,operator,right) @left = left @operator = operator @right = right end |
Instance Attribute Details
#left ⇒ Statement, ... (readonly)
The left-hand side of the binary expression.
40 41 42 |
# File 'lib/ronin/code/sql/binary_expr.rb', line 40 def left @left end |
#operator ⇒ Symbol (readonly)
The binary expression's operator.
45 46 47 |
# File 'lib/ronin/code/sql/binary_expr.rb', line 45 def operator @operator end |
#right ⇒ Object (readonly)
The right-hand side of the binary expression.
50 51 52 |
# File 'lib/ronin/code/sql/binary_expr.rb', line 50 def right @right end |
Instance Method Details
#to_sql(**kwargs) ⇒ String
Converts the binary expression to SQL.
79 80 81 |
# File 'lib/ronin/code/sql/binary_expr.rb', line 79 def to_sql(**kwargs) emitter(**kwargs).emit_expression(self) end |