Class: Chicago::Schema::AbstractQualifiedColumn Abstract

Inherits:
QueryColumn
  • Object
show all
Defined in:
lib/chicago/schema/query_column.rb

Overview

This class is abstract.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from QueryColumn

column, #filter_dataset, #method_missing, #qualified_label

Constructor Details

#initialize(owner, column, column_alias, table_label = nil) ⇒ AbstractQualifiedColumn

Returns a new instance of AbstractQualifiedColumn.



63
64
65
66
67
# File 'lib/chicago/schema/query_column.rb', line 63

def initialize(owner, column, column_alias, table_label=nil)
  super column, table_label
  @owner = owner
  @column_alias = column_alias
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Chicago::Schema::QueryColumn

Instance Attribute Details

#column_aliasObject (readonly)

Returns the value of attribute column_alias.



68
69
70
# File 'lib/chicago/schema/query_column.rb', line 68

def column_alias
  @column_alias
end

#count_nameObject (readonly)

Returns the value of attribute count_name.



68
69
70
# File 'lib/chicago/schema/query_column.rb', line 68

def count_name
  @count_name
end

#group_nameObject (readonly)

Returns the value of attribute group_name.



68
69
70
# File 'lib/chicago/schema/query_column.rb', line 68

def group_name
  @group_name
end

#ownerObject (readonly)

Returns the value of attribute owner.



68
69
70
# File 'lib/chicago/schema/query_column.rb', line 68

def owner
  @owner
end

#select_nameObject (readonly)

Returns the value of attribute select_name.



68
69
70
# File 'lib/chicago/schema/query_column.rb', line 68

def select_name
  @select_name
end

Instance Method Details

#calculate(operation) ⇒ Object



76
77
78
# File 'lib/chicago/schema/query_column.rb', line 76

def calculate(operation)
  CalculatedColumn.make(operation, self)
end

#pivot(pivot_col, elements, unit) ⇒ Object



70
71
72
73
74
# File 'lib/chicago/schema/query_column.rb', line 70

def pivot(pivot_col, elements, unit)
  elements.zip((0..elements.size).to_a).map do |e,i|
    PivotedColumn.new(self, pivot_col, i, e, unit)
  end
end