Class: Alf::Sql::Cog
- Inherits:
-
Object
- Object
- Alf::Sql::Cog
- Includes:
- Compiler::Cog
- Defined in:
- lib/alf/sql/cog.rb
Instance Attribute Summary collapse
-
#sexpr ⇒ Object
(also: #to_sexpr)
readonly
Returns the value of attribute sexpr.
Instance Method Summary collapse
- #cog_orders ⇒ Object
- #each(&bl) ⇒ Object
-
#initialize(expr, compiler, sexpr) ⇒ Cog
constructor
A new instance of Cog.
- #should_be_reused? ⇒ Boolean
- #to_sql(buffer = "") ⇒ Object
Constructor Details
#initialize(expr, compiler, sexpr) ⇒ Cog
Returns a new instance of Cog.
6 7 8 9 |
# File 'lib/alf/sql/cog.rb', line 6 def initialize(expr, compiler, sexpr) super(expr, compiler) @sexpr = sexpr end |
Instance Attribute Details
#sexpr ⇒ Object (readonly) Also known as: to_sexpr
Returns the value of attribute sexpr.
10 11 12 |
# File 'lib/alf/sql/cog.rb', line 10 def sexpr @sexpr end |
Instance Method Details
#cog_orders ⇒ Object
13 14 15 |
# File 'lib/alf/sql/cog.rb', line 13 def cog_orders [ sexpr.ordering ].compact end |
#each(&bl) ⇒ Object
25 26 27 28 |
# File 'lib/alf/sql/cog.rb', line 25 def each(&bl) raise NotSupportedError,\ "This is an abstract SQL compilation result. Please use alf-sequel." end |
#should_be_reused? ⇒ Boolean
17 18 19 |
# File 'lib/alf/sql/cog.rb', line 17 def should_be_reused? sexpr.should_be_reused? end |
#to_sql(buffer = "") ⇒ Object
21 22 23 |
# File 'lib/alf/sql/cog.rb', line 21 def to_sql(buffer = "") sexpr.to_sql(buffer) end |