Class: Optimus::Transformers::Multipasser::Pass

Inherits:
Object
  • Object
show all
Defined in:
lib/transformers/multipasser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sort_expression = "1", row_filter = lambda{|r| true}, computed_columns = []) ⇒ Pass

Returns a new instance of Pass.



31
32
33
34
35
36
37
38
# File 'lib/transformers/multipasser.rb', line 31

def initialize(
    sort_expression = "1", 
    row_filter = lambda{|r| true}, 
    computed_columns = [])
  @sort_expression = sort_expression
  @row_filter = row_filter
  @computed_columns = computed_columns
end

Instance Attribute Details

#computed_columnsObject

Returns the value of attribute computed_columns.



30
31
32
# File 'lib/transformers/multipasser.rb', line 30

def computed_columns
  @computed_columns
end

#row_filterObject

Returns the value of attribute row_filter.



30
31
32
# File 'lib/transformers/multipasser.rb', line 30

def row_filter
  @row_filter
end

#sort_expressionObject

Returns the value of attribute sort_expression.



30
31
32
# File 'lib/transformers/multipasser.rb', line 30

def sort_expression
  @sort_expression
end

Instance Method Details

#computed_column(name, expression) ⇒ Object



40
41
42
# File 'lib/transformers/multipasser.rb', line 40

def computed_column(name, expression)
  computed_columns << [name, expression]
end