Class: FilterRename::Filters::SplitWord

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



934
935
936
# File 'lib/filter_rename/filters.rb', line 934

def self.hint
  "Split the NTH word using a REGEX with capturing groups"
end

.paramsObject



938
939
940
# File 'lib/filter_rename/filters.rb', line 938

def self.params
  "NTH,REGEX"
end

Instance Method Details

#filtered_word(word, _param_num) ⇒ Object



942
943
944
# File 'lib/filter_rename/filters.rb', line 942

def filtered_word(word, _param_num)
  word.scan(Regexp.new(wrap_regex(params[1]), get_config(:ignore_case))).pop.to_a.join(ws)
end