Class: MigrationDefs::RenameTableFunc
- Inherits:
-
AbstractMigrationClass
- Object
- AbstractMigrationClass
- MigrationDefs::RenameTableFunc
- Defined in:
- lib/migration_defs.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#new_name ⇒ Object
Returns the value of attribute new_name.
Instance Method Summary collapse
- #add_new_name(new_name) ⇒ Object
- #get_str ⇒ Object
-
#initialize(name) ⇒ RenameTableFunc
constructor
A new instance of RenameTableFunc.
- #parse_from_params(parse_params) ⇒ Object
Constructor Details
#initialize(name) ⇒ RenameTableFunc
Returns a new instance of RenameTableFunc.
316 317 318 |
# File 'lib/migration_defs.rb', line 316 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
314 315 316 |
# File 'lib/migration_defs.rb', line 314 def name @name end |
#new_name ⇒ Object
Returns the value of attribute new_name.
314 315 316 |
# File 'lib/migration_defs.rb', line 314 def new_name @new_name end |
Instance Method Details
#add_new_name(new_name) ⇒ Object
320 321 322 |
# File 'lib/migration_defs.rb', line 320 def add_new_name(new_name) @new_name = new_name end |
#get_str ⇒ Object
328 329 330 |
# File 'lib/migration_defs.rb', line 328 def get_str "rename_table :#{@name}" + (@new_name.blank? ? '' : ":#{@new_name}") + "\n" end |
#parse_from_params(parse_params) ⇒ Object
324 325 326 |
# File 'lib/migration_defs.rb', line 324 def parse_from_params(parse_params) @new_name = parse_params[:new_table_name] end |