class FilterRename::FilterWord
Public Instance Methods
filter(params)
click to toggle source
Calls superclass method
FilterRename::FilterBase#filter
# File lib/filter_rename/filter_base.rb, line 124 def filter(params) super loop_words(get_string, get_indexes(params, :word_idx), params) end
Private Instance Methods
loop_words(str, arr_index, params)
click to toggle source
# File lib/filter_rename/filter_base.rb, line 144 def loop_words(str, arr_index, params) str = str.split(ws) arr_index.each_with_index do |idx, param_num| str[idx] = send :filtered_word, str[idx], params, param_num.next end str.delete_if(&:nil?).join(ws) end
word_idx(idx, str)
click to toggle source
# File lib/filter_rename/filter_base.rb, line 135 def word_idx(idx, str) if idx.to_i.positive? idx = idx.to_i.pred elsif idx.to_i.negative? idx = idx.to_i + str.split(ws).length end idx.to_i end
ws()
click to toggle source
# File lib/filter_rename/filter_base.rb, line 131 def ws get_config(:word_separator) end