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.



697
698
699
700
701
702
# File 'lib/flydata/command/sync.rb', line 697

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.



704
705
706
# File 'lib/flydata/command/sync.rb', line 704

def columns
  @columns
end

#primary_keysObject

Returns the value of attribute primary_keys.



704
705
706
# File 'lib/flydata/command/sync.rb', line 704

def primary_keys
  @primary_keys
end

#table_nameObject

Returns the value of attribute table_name.



704
705
706
# File 'lib/flydata/command/sync.rb', line 704

def table_name
  @table_name
end

Instance Method Details

#adapter(key) ⇒ Object



714
715
716
# File 'lib/flydata/command/sync.rb', line 714

def adapter(key)
  @adapters[key]
end

#add_column(column) ⇒ Object



706
707
708
# File 'lib/flydata/command/sync.rb', line 706

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

#set_adapter(key, adapter) ⇒ Object



710
711
712
# File 'lib/flydata/command/sync.rb', line 710

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