Class: Flydata::Parser::Mysql::MysqlTable
- Inherits:
-
Object
- Object
- Flydata::Parser::Mysql::MysqlTable
- Defined in:
- lib/flydata/parser/mysql/dump_parser.rb
Instance Attribute Summary collapse
-
#column_names ⇒ Object
Returns the value of attribute column_names.
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#format_types ⇒ Object
Returns the value of attribute format_types.
-
#primary_keys ⇒ Object
Returns the value of attribute primary_keys.
-
#table_name ⇒ Object
Returns the value of attribute table_name.
Instance Method Summary collapse
- #add_column(column) ⇒ Object
-
#initialize(table_name, columns = {}, primary_keys = []) ⇒ MysqlTable
constructor
A new instance of MysqlTable.
Constructor Details
#initialize(table_name, columns = {}, primary_keys = []) ⇒ MysqlTable
Returns a new instance of MysqlTable.
32 33 34 35 36 37 38 |
# File 'lib/flydata/parser/mysql/dump_parser.rb', line 32 def initialize(table_name, columns = {}, primary_keys = []) @table_name = table_name @columns = columns @column_names = columns.collect{|k,v| v[:column_name]} @format_types = columns.collect{|k,v| v[:format_type]} @primary_keys = primary_keys end |
Instance Attribute Details
#column_names ⇒ Object
Returns the value of attribute column_names.
40 41 42 |
# File 'lib/flydata/parser/mysql/dump_parser.rb', line 40 def column_names @column_names end |
#columns ⇒ Object
Returns the value of attribute columns.
40 41 42 |
# File 'lib/flydata/parser/mysql/dump_parser.rb', line 40 def columns @columns end |
#format_types ⇒ Object
Returns the value of attribute format_types.
40 41 42 |
# File 'lib/flydata/parser/mysql/dump_parser.rb', line 40 def format_types @format_types end |
#primary_keys ⇒ Object
Returns the value of attribute primary_keys.
40 41 42 |
# File 'lib/flydata/parser/mysql/dump_parser.rb', line 40 def primary_keys @primary_keys end |
#table_name ⇒ Object
Returns the value of attribute table_name.
40 41 42 |
# File 'lib/flydata/parser/mysql/dump_parser.rb', line 40 def table_name @table_name end |
Instance Method Details
#add_column(column) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/flydata/parser/mysql/dump_parser.rb', line 43 def add_column(column) cn = column[:column_name] @columns[cn] = column @column_names << cn @format_types << column[:format_type] end |