Class: MigrationDefs::RenameIndexFunc

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ RenameIndexFunc

Returns a new instance of RenameIndexFunc.



587
588
589
590
591
# File 'lib/migration_defs.rb', line 587

def initialize(name)
  @name = name
  @index_name = "''"
  @new_index_name = "''"
end

Instance Attribute Details

#index_nameObject

Returns the value of attribute index_name.



585
586
587
# File 'lib/migration_defs.rb', line 585

def index_name
  @index_name
end

#nameObject

Returns the value of attribute name.



585
586
587
# File 'lib/migration_defs.rb', line 585

def name
  @name
end

#new_index_nameObject

Returns the value of attribute new_index_name.



585
586
587
# File 'lib/migration_defs.rb', line 585

def new_index_name
  @new_index_name
end

Instance Method Details

#get_strObject



598
599
600
601
602
603
# File 'lib/migration_defs.rb', line 598

def get_str
  result = "rename_index :#{@name}"
  result += ", #{@index_name}" if !@index_name.nil? && !@index_name.blank?
  result += ", #{@new_index_name}" if !@new_index_name.nil? && !@new_index_name.blank?
  result += "\n"
end

#parse_from_params(parse_params) ⇒ Object



593
594
595
596
# File 'lib/migration_defs.rb', line 593

def parse_from_params(parse_params)
  @index_name = parse_params[:index_name]
  @new_index_name = parse_params[:new_index_name]
end