Class: Flydata::Parser::Mysql::MysqlTable

Inherits:
Object
  • Object
show all
Defined in:
lib/flydata/parser/mysql/dump_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of MysqlTable.


31
32
33
34
35
# File 'lib/flydata/parser/mysql/dump_parser.rb', line 31

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

Instance Attribute Details

#columnsObject

Returns the value of attribute columns.


37
38
39
# File 'lib/flydata/parser/mysql/dump_parser.rb', line 37

def columns
  @columns
end

#primary_keysObject

Returns the value of attribute primary_keys.


37
38
39
# File 'lib/flydata/parser/mysql/dump_parser.rb', line 37

def primary_keys
  @primary_keys
end

#table_nameObject

Returns the value of attribute table_name.


37
38
39
# File 'lib/flydata/parser/mysql/dump_parser.rb', line 37

def table_name
  @table_name
end

Instance Method Details

#add_column(column) ⇒ Object


39
40
41
# File 'lib/flydata/parser/mysql/dump_parser.rb', line 39

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