Class: MigrationDefs::RemoveColumnFunc
- Inherits:
-
AbstractMigrationClass
- Object
- AbstractMigrationClass
- MigrationDefs::RemoveColumnFunc
- Defined in:
- lib/migration_defs.rb
Instance Attribute Summary collapse
-
#column_name ⇒ Object
Returns the value of attribute column_name.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #add_column_name(column_name) ⇒ Object
- #get_str ⇒ Object
-
#initialize(name) ⇒ RemoveColumnFunc
constructor
A new instance of RemoveColumnFunc.
- #parse_from_params(parse_params) ⇒ Object
Constructor Details
#initialize(name) ⇒ RemoveColumnFunc
Returns a new instance of RemoveColumnFunc.
388 389 390 |
# File 'lib/migration_defs.rb', line 388 def initialize(name) @name = name end |
Instance Attribute Details
#column_name ⇒ Object
Returns the value of attribute column_name.
386 387 388 |
# File 'lib/migration_defs.rb', line 386 def column_name @column_name end |
#name ⇒ Object
Returns the value of attribute name.
386 387 388 |
# File 'lib/migration_defs.rb', line 386 def name @name end |
Instance Method Details
#add_column_name(column_name) ⇒ Object
392 393 394 |
# File 'lib/migration_defs.rb', line 392 def add_column_name(column_name) @column_name = column_name end |
#get_str ⇒ Object
400 401 402 |
# File 'lib/migration_defs.rb', line 400 def get_str "remove_column :#{@name}" + (@column_name.blank? ? '' : ", :#{@column_name}") + "\n" end |
#parse_from_params(parse_params) ⇒ Object
396 397 398 |
# File 'lib/migration_defs.rb', line 396 def parse_from_params(parse_params) @column_name = parse_params[:column_name] end |