Class: FilterRename::Filters::MoveWord

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, #normalize_index, #self_targeted?, #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



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

def self.hint; 'Move the NTH1 word to the NTH2 place'; end

.paramsObject



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

def self.params; 'NTH1,NTH2'; end

Instance Method Details

#filtered_word(word, param_num) ⇒ Object



458
459
460
461
462
463
464
465
466
467
468
469
470
471
# File 'lib/filter_rename/filters.rb', line 458

def filtered_word(word, param_num)
  case param_num
  when 1
    @word = word
    res = nil
  when params_expanded.length
    res = [word, @word].join(ws)
  else
    @word = [@word, word].join(ws)
    res = nil
  end

  res
end

#indexed_paramsObject



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

def indexed_params; 2; end