Class: FilterRename::Filters::AppendWordTo

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, #indexed_params, #indexes, #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

.hint ⇒ Object



198
199
200
# File 'lib/filter_rename/filters.rb', line 198

def self.hint
  "Append the NTH word to TARGET"
end

.params ⇒ Object



202
203
204
# File 'lib/filter_rename/filters.rb', line 202

def self.params
  "NTH,TARGET"
end

Instance Method Details

#filtered_word(word, _param_num) ⇒ Object



210
211
212
213
# File 'lib/filter_rename/filters.rb', line 210

def filtered_word(word, _param_num)
  set_string([get_string(params[1]), word].join(ws), params[1])
  word
end

#self_targeted? ⇒ Boolean

Returns:



206
207
208
# File 'lib/filter_rename/filters.rb', line 206

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