Class: FilterRename::Filters::MoveWordTo

Inherits:
FilterRename::FilterWord show all
Defined in:
lib/filter_rename/filters.rb

Instance Attribute Summary

Attributes included from IndexedParams

#items, #params, #params_expanded

Class Method Summary collapse

Instance Method Summary collapse

Methods included from IndexedParams

#filter, #get_indexes, #indexed_params, #normalize_index, #string_to_loop

Methods inherited from FilterRename::FilterBase

#current_target, #filter, #get_config, #get_string, #get_words, #initialize, #match?, #set_config, #set_string, #wrap_regex

Constructor Details

This class inherits a constructor from FilterRename::FilterBase

Class Method Details

.hintObject



476
# File 'lib/filter_rename/filters.rb', line 476

def self.hint; 'Move the NTH word to TARGET overwriting it'; end

.paramsObject



477
# File 'lib/filter_rename/filters.rb', line 477

def self.params; 'NTH,TARGET'; end

Instance Method Details

#filtered_word(word, param_num) ⇒ Object



483
484
485
486
# File 'lib/filter_rename/filters.rb', line 483

def filtered_word(word, param_num)
  set_string(word, params[1])
  nil
end

#self_targeted?Boolean

Returns:



479
480
481
# File 'lib/filter_rename/filters.rb', line 479

def self_targeted?
  params[-1] == current_target
end