Class: Gamma::Table
- Inherits:
-
Object
- Object
- Gamma::Table
- Defined in:
- lib/gamma/table.rb
Instance Attribute Summary collapse
-
#delta_column ⇒ Object
Returns the value of attribute delta_column.
-
#hooks ⇒ Object
Returns the value of attribute hooks.
-
#in_exist ⇒ Object
Returns the value of attribute in_exist.
-
#in_exist_columns ⇒ Object
Returns the value of attribute in_exist_columns.
-
#out_exist ⇒ Object
Returns the value of attribute out_exist.
-
#out_exist_columns ⇒ Object
Returns the value of attribute out_exist_columns.
-
#sync_mode ⇒ Object
Returns the value of attribute sync_mode.
-
#table_name ⇒ Object
Returns the value of attribute table_name.
Instance Method Summary collapse
Instance Attribute Details
#delta_column ⇒ Object
Returns the value of attribute delta_column.
3 4 5 |
# File 'lib/gamma/table.rb', line 3 def delta_column @delta_column end |
#hooks ⇒ Object
Returns the value of attribute hooks.
4 5 6 |
# File 'lib/gamma/table.rb', line 4 def hooks @hooks end |
#in_exist ⇒ Object
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_columns ⇒ Object
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_exist ⇒ Object
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_columns ⇒ Object
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_mode ⇒ Object
Returns the value of attribute sync_mode.
3 4 5 |
# File 'lib/gamma/table.rb', line 3 def sync_mode @sync_mode end |
#table_name ⇒ Object
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 |