Class: Prequel::Expressions::Column
- Inherits:
-
Object
- Object
- Prequel::Expressions::Column
- Defined in:
- lib/prequel/expressions/column.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #alias_name ⇒ Object
- #eq(other) ⇒ Object
- #expression ⇒ Object
-
#initialize(table, name, type) ⇒ Column
constructor
A new instance of Column.
- #origin ⇒ Object
- #qualified_name ⇒ Object
- #resolve_in_query(query) ⇒ Object
Constructor Details
#initialize(table, name, type) ⇒ Column
Returns a new instance of Column.
6 7 8 |
# File 'lib/prequel/expressions/column.rb', line 6 def initialize(table, name, type) @table, @name, @type = table, name, type end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/prequel/expressions/column.rb', line 4 def name @name end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
4 5 6 |
# File 'lib/prequel/expressions/column.rb', line 4 def table @table end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/prequel/expressions/column.rb', line 4 def type @type end |
Instance Method Details
#alias_name ⇒ Object
10 11 12 |
# File 'lib/prequel/expressions/column.rb', line 10 def alias_name nil end |
#eq(other) ⇒ Object
14 15 16 |
# File 'lib/prequel/expressions/column.rb', line 14 def eq(other) Equal.new(self, other) end |
#expression ⇒ Object
22 23 24 |
# File 'lib/prequel/expressions/column.rb', line 22 def expression self end |
#origin ⇒ Object
26 27 28 |
# File 'lib/prequel/expressions/column.rb', line 26 def origin self end |
#qualified_name ⇒ Object
18 19 20 |
# File 'lib/prequel/expressions/column.rb', line 18 def qualified_name "#{table.name}__#{name}".to_sym end |
#resolve_in_query(query) ⇒ Object
30 31 32 |
# File 'lib/prequel/expressions/column.rb', line 30 def resolve_in_query(query) query.singular_table_refs[table].resolve_column(self) end |