Class: Gamma::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/gamma/table.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#delta_columnObject

Returns the value of attribute delta_column.



3
4
5
# File 'lib/gamma/table.rb', line 3

def delta_column
  @delta_column
end

#hooksObject

Returns the value of attribute hooks.



4
5
6
# File 'lib/gamma/table.rb', line 4

def hooks
  @hooks
end

#in_existObject

Returns the value of attribute in_exist.



2
3
4
# File 'lib/gamma/table.rb', line 2

def in_exist
  @in_exist
end

#in_exist_columnsObject

Returns the value of attribute in_exist_columns.



2
3
4
# File 'lib/gamma/table.rb', line 2

def in_exist_columns
  @in_exist_columns
end

#out_existObject

Returns the value of attribute out_exist.



2
3
4
# File 'lib/gamma/table.rb', line 2

def out_exist
  @out_exist
end

#out_exist_columnsObject

Returns the value of attribute out_exist_columns.



2
3
4
# File 'lib/gamma/table.rb', line 2

def out_exist_columns
  @out_exist_columns
end

#sync_modeObject

Returns the value of attribute sync_mode.



3
4
5
# File 'lib/gamma/table.rb', line 3

def sync_mode
  @sync_mode
end

#table_nameObject

Returns the value of attribute table_name.



2
3
4
# File 'lib/gamma/table.rb', line 2

def table_name
  @table_name
end

Instance Method Details

#record_value(record) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/gamma/table.rb', line 6

def record_value(record)
  row_hooks = hooks.select { |h| h.hook_type.to_s == "row" }
  column_hooks = hooks.select { |h| h.hook_type.to_s == "column" }

  result = record
  result = row_hooks.reduce(record) { |h, rec| execute_row_hook(rec, h) } if row_hooks.present?
  result = column_hooks.reduce(record) { |h, rec| execute_row_hook(rec, h) } if column_hooks.present?

  result
end