Class: Flydata::Mysql::MysqlTable
- Inherits:
-
Object
- Object
- Flydata::Mysql::MysqlTable
- Defined in:
- lib/flydata/command/sync.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#primary_keys ⇒ Object
Returns the value of attribute primary_keys.
-
#table_name ⇒ Object
Returns the value of attribute table_name.
Instance Method Summary collapse
- #adapter(key) ⇒ Object
- #add_column(column) ⇒ Object
-
#initialize(table_name, columns = {}, primary_keys = []) ⇒ MysqlTable
constructor
A new instance of MysqlTable.
- #set_adapter(key, adapter) ⇒ Object
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
#columns ⇒ Object
Returns the value of attribute columns.
712 713 714 |
# File 'lib/flydata/command/sync.rb', line 712 def columns @columns end |
#primary_keys ⇒ Object
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_name ⇒ Object
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 |