Class: Prequel::Sql::QueryColumn

Inherits:
Object
  • Object
show all
Defined in:
lib/prequel/sql/query_column.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/prequel/sql/query_column.rb', line 4

def name
  @name
end

#table_refObject (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_nameObject



17
18
19
# File 'lib/prequel/sql/query_column.rb', line 17

def qualified_name
  "#{table_ref.name}__#{name}"
end

#to_select_clause_sqlObject



13
14
15
# File 'lib/prequel/sql/query_column.rb', line 13

def to_select_clause_sql
  to_sql
end

#to_sqlObject



9
10
11
# File 'lib/prequel/sql/query_column.rb', line 9

def to_sql
  "#{table_ref.name}.#{name}"
end