Class: Prequel::Sql::QueryColumn
- Inherits:
-
Object
- Object
- Prequel::Sql::QueryColumn
- Defined in:
- lib/prequel/sql/query_column.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#table_ref ⇒ Object
readonly
Returns the value of attribute table_ref.
Instance Method Summary collapse
-
#initialize(table_ref, name) ⇒ QueryColumn
constructor
A new instance of QueryColumn.
- #qualified_name ⇒ Object
- #to_select_clause_sql ⇒ Object
- #to_sql ⇒ Object
Constructor Details
#initialize(table_ref, name) ⇒ QueryColumn
Returns a new instance of QueryColumn.
5 6 7 |
# File 'lib/prequel/sql/query_column.rb', line 5 def initialize(table_ref, name) @table_ref, @name = table_ref, name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/prequel/sql/query_column.rb', line 4 def name @name end |
#table_ref ⇒ Object (readonly)
Returns the value of attribute table_ref.
4 5 6 |
# File 'lib/prequel/sql/query_column.rb', line 4 def table_ref @table_ref end |
Instance Method Details
#qualified_name ⇒ Object
17 18 19 |
# File 'lib/prequel/sql/query_column.rb', line 17 def qualified_name "#{table_ref.name}__#{name}" end |
#to_select_clause_sql ⇒ Object
13 14 15 |
# File 'lib/prequel/sql/query_column.rb', line 13 def to_select_clause_sql to_sql end |
#to_sql ⇒ Object
9 10 11 |
# File 'lib/prequel/sql/query_column.rb', line 9 def to_sql "#{table_ref.name}.#{name}" end |