Class: FilterRename::Filters::AppendAsWordTo

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FilterRename::FilterBase

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



96
97
98
# File 'lib/filter_rename/filters.rb', line 96

def self.hint
  "Append the TEXT to TARGET as a word"
end

.params ⇒ Object



100
101
102
# File 'lib/filter_rename/filters.rb', line 100

def self.params
  "TEXT,TARGET"
end

Instance Method Details

#filter(params) ⇒ Object



104
105
106
107
108
# File 'lib/filter_rename/filters.rb', line 104

def filter(params)
  ws = get_config(:word_separator)
  set_string(get_string(params[1]).to_s.split(ws).push(params[0]).join(ws), params[1])
  super(get_string)
end