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.
389 390 391 |
# File 'lib/migration_defs.rb', line 389 def initialize(name) @name = name end |
Instance Attribute Details
#column_name ⇒ Object
Returns the value of attribute column_name.
387 388 389 |
# File 'lib/migration_defs.rb', line 387 def column_name @column_name end |
#name ⇒ Object
Returns the value of attribute name.
387 388 389 |
# File 'lib/migration_defs.rb', line 387 def name @name end |
Instance Method Details
#add_column_name(column_name) ⇒ Object
393 394 395 |
# File 'lib/migration_defs.rb', line 393 def add_column_name(column_name) @column_name = column_name end |
#get_str ⇒ Object
401 402 403 |
# File 'lib/migration_defs.rb', line 401 def get_str "remove_column :#{@name}" + (@column_name.blank? ? '' : ", :#{@column_name}") + "\n" end |
#parse_from_params(parse_params) ⇒ Object
397 398 399 |
# File 'lib/migration_defs.rb', line 397 def parse_from_params(parse_params) @column_name = parse_params[:column_name] end |