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



675
676
677
678
679
680
# File 'lib/flydata/command/sync.rb', line 675

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.



682
683
684
# File 'lib/flydata/command/sync.rb', line 682

def columns
  @columns
end

#primary_keysObject

Returns the value of attribute primary_keys.



682
683
684
# File 'lib/flydata/command/sync.rb', line 682

def primary_keys
  @primary_keys
end

#table_nameObject

Returns the value of attribute table_name.



682
683
684
# File 'lib/flydata/command/sync.rb', line 682

def table_name
  @table_name
end

Instance Method Details

#adapter(key) ⇒ Object



692
693
694
# File 'lib/flydata/command/sync.rb', line 692

def adapter(key)
  @adapters[key]
end

#add_column(column) ⇒ Object



684
685
686
# File 'lib/flydata/command/sync.rb', line 684

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

#set_adapter(key, adapter) ⇒ Object



688
689
690
# File 'lib/flydata/command/sync.rb', line 688

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