Module: Ronin::SQL::Emittable
- Included in:
- BinaryExpr, Clause, Field, Function, InjectionExpr, Literal, Statement, StatementList, UnaryExpr
- Defined in:
- lib/ronin/sql/emittable.rb
Overview
Allows an object to be converted to raw SQL.
Instance Method Summary collapse
-
#emitter(options = {}) ⇒ Object
private
Creates a new emitter.
-
#inspect ⇒ String
Inspects the object.
- #to_s ⇒ Object
-
#to_sql(options = {}) ⇒ String
The default
to_sql
method.
Instance Method Details
#emitter(options = {}) ⇒ 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.
41 42 43 |
# File 'lib/ronin/sql/emittable.rb', line 41 def emitter(={}) Emitter.new() end |
#inspect ⇒ String
Inspects the object.
83 84 85 |
# File 'lib/ronin/sql/emittable.rb', line 83 def inspect "#<#{self.class}: #{to_sql}>" end |
#to_s ⇒ Object
73 74 75 |
# File 'lib/ronin/sql/emittable.rb', line 73 def to_s to_sql end |
#to_sql(options = {}) ⇒ String
The default to_sql
method.
66 67 68 |
# File 'lib/ronin/sql/emittable.rb', line 66 def to_sql(={}) emitter().emit(self) end |