Class: Flydata::Mysql::MysqlTable

Inherits:
Object
  • Object
show all
Defined in:
lib/flydata/command/sync.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table_name, columns = {}, primary_keys = []) ⇒ MysqlTable

Returns a new instance of MysqlTable.



736
737
738
739
740
741
# File 'lib/flydata/command/sync.rb', line 736

def initialize(table_name, columns = {}, primary_keys = [])
  @table_name = table_name
  @columns = columns
  @primary_keys = primary_keys
  @adapters = {}
end

Instance Attribute Details

#columnsObject

Returns the value of attribute columns.



743
744
745
# File 'lib/flydata/command/sync.rb', line 743

def columns
  @columns
end

#primary_keysObject

Returns the value of attribute primary_keys.



743
744
745
# File 'lib/flydata/command/sync.rb', line 743

def primary_keys
  @primary_keys
end

#table_nameObject

Returns the value of attribute table_name.



743
744
745
# File 'lib/flydata/command/sync.rb', line 743

def table_name
  @table_name
end

Instance Method Details

#adapter(key) ⇒ Object



753
754
755
# File 'lib/flydata/command/sync.rb', line 753

def adapter(key)
  @adapters[key]
end

#add_column(column) ⇒ Object



745
746
747
# File 'lib/flydata/command/sync.rb', line 745

def add_column(column)
  @columns[column[:column_name]] = column
end

#set_adapter(key, adapter) ⇒ Object



749
750
751
# File 'lib/flydata/command/sync.rb', line 749

def set_adapter(key, adapter)
  @adapters[key] = adapter
end