Module: Ronin::Code::SQL::Emittable
- Included in:
- BinaryExpr, Clause, Field, Function, InjectionExpr, Literal, Statement, StatementList, UnaryExpr
- Defined in:
- lib/ronin/code/sql/emittable.rb
Overview
Allows an object to be converted to raw SQL.
Instance Method Summary collapse
-
#emitter(**kwargs) ⇒ Object
private
Creates a new emitter.
-
#inspect ⇒ String
Inspects the object.
- #to_s ⇒ Object
-
#to_sql(**kwargs) ⇒ String
The default
to_sql
method.
Instance Method Details
#emitter(**kwargs) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a new emitter.
40 41 42 |
# File 'lib/ronin/code/sql/emittable.rb', line 40 def emitter(**kwargs) Emitter.new(**kwargs) end |
#inspect ⇒ String
Inspects the object.
89 90 91 |
# File 'lib/ronin/code/sql/emittable.rb', line 89 def inspect "#<#{self.class}: #{to_sql}>" end |
#to_s ⇒ Object
79 80 81 |
# File 'lib/ronin/code/sql/emittable.rb', line 79 def to_s to_sql end |
#to_sql(**kwargs) ⇒ String
The default to_sql
method.
72 73 74 |
# File 'lib/ronin/code/sql/emittable.rb', line 72 def to_sql(**kwargs) emitter(**kwargs).emit(self) end |