Class: PgSerializable::Nodes::As
- Defined in:
- lib/pg_serializable/nodes/as.rb
Instance Method Summary collapse
-
#initialize(scope, table_alias) ⇒ As
constructor
A new instance of As.
- #to_sql ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(scope, table_alias) ⇒ As
Returns a new instance of As.
4 5 6 7 |
# File 'lib/pg_serializable/nodes/as.rb', line 4 def initialize(scope, table_alias) @scope = scope @table_alias = table_alias end |
Instance Method Details
#to_sql ⇒ Object
9 10 11 |
# File 'lib/pg_serializable/nodes/as.rb', line 9 def to_sql "(#{@scope.respond_to?(:to_sql) ? @scope.to_sql : @scope.to_s}) #{@table_alias}" end |