Class: GammaReplication::Table

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

Constant Summary collapse

DEFAULT_PRIMARY_KEY =
"id"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTable

Returns a new instance of Table.



10
11
12
13
14
# File 'lib/gamma_replication/table.rb', line 10

def initialize
  @hooks = []
  @in_exist_columns = []
  @out_exist_columns = []
end

Instance Attribute Details

#hooksObject

Returns the value of attribute hooks.



7
8
9
# File 'lib/gamma_replication/table.rb', line 7

def hooks
  @hooks
end

#in_existObject

Returns the value of attribute in_exist.



7
8
9
# File 'lib/gamma_replication/table.rb', line 7

def in_exist
  @in_exist
end

#in_exist_columnsObject

Returns the value of attribute in_exist_columns.



7
8
9
# File 'lib/gamma_replication/table.rb', line 7

def in_exist_columns
  @in_exist_columns
end

#out_existObject

Returns the value of attribute out_exist.



7
8
9
# File 'lib/gamma_replication/table.rb', line 7

def out_exist
  @out_exist
end

#out_exist_columnsObject

Returns the value of attribute out_exist_columns.



7
8
9
# File 'lib/gamma_replication/table.rb', line 7

def out_exist_columns
  @out_exist_columns
end

#table_nameObject

Returns the value of attribute table_name.



7
8
9
# File 'lib/gamma_replication/table.rb', line 7

def table_name
  @table_name
end

Instance Method Details

#primary_keyObject



24
25
26
# File 'lib/gamma_replication/table.rb', line 24

def primary_key
  DEFAULT_PRIMARY_KEY
end

#record_value(record) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/gamma_replication/table.rb', line 16

def record_value(record)
  result = record.dup
  hooks.each do |hook|
    result = hook.execute_script(result)
  end
  result
end