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.



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

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

Instance Attribute Details

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#optionObject

Returns the value of attribute option.



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

def option
  @option
end

Instance Method Details

#get_strObject



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

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

#parse_from_params(parse_params) ⇒ Object



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

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