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.



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

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.



712
713
714
# File 'lib/flydata/command/sync.rb', line 712

def columns
  @columns
end

#primary_keysObject

Returns the value of attribute primary_keys.



712
713
714
# File 'lib/flydata/command/sync.rb', line 712

def primary_keys
  @primary_keys
end

#table_nameObject

Returns the value of attribute table_name.



712
713
714
# File 'lib/flydata/command/sync.rb', line 712

def table_name
  @table_name
end

Instance Method Details

#adapter(key) ⇒ Object



722
723
724
# File 'lib/flydata/command/sync.rb', line 722

def adapter(key)
  @adapters[key]
end

#add_column(column) ⇒ Object



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

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

#set_adapter(key, adapter) ⇒ Object



718
719
720
# File 'lib/flydata/command/sync.rb', line 718

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