Class: MigrationDefs::RemoveIndexFunc

Inherits:
AbstractMigrationClass show all
Defined in:
lib/migration_defs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ RemoveIndexFunc

Returns a new instance of RemoveIndexFunc.



568
569
570
571
# File 'lib/migration_defs.rb', line 568

def initialize(name)
  @name = name
  @option = RemoveIndexOption.new
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



566
567
568
# File 'lib/migration_defs.rb', line 566

def name
  @name
end

#optionObject

Returns the value of attribute option.



566
567
568
# File 'lib/migration_defs.rb', line 566

def option
  @option
end

Instance Method Details

#get_strObject



578
579
580
# File 'lib/migration_defs.rb', line 578

def get_str
  return "remove_index :#{@name} #{@option.get_str}\n"
end

#parse_from_params(parse_params) ⇒ Object



573
574
575
576
# File 'lib/migration_defs.rb', line 573

def parse_from_params(parse_params)
  @option.set_option 'name', parse_params[:index_name]
  @option.set_option 'column', parse_params[:columns]
end