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.



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

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

Instance Attribute Details

#index_nameObject

Returns the value of attribute index_name.



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

def index_name
  @index_name
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#new_index_nameObject

Returns the value of attribute new_index_name.



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

def new_index_name
  @new_index_name
end

Instance Method Details

#get_strObject



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

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



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

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