Class: FilterRename::Filters::MoveTo
Class Method Summary
collapse
Instance Method Summary
collapse
#get_config, #get_string, #get_words, #initialize, #match?, #set_config, #set_string, #wrap_regex
Class Method Details
.hint ⇒ Object
299
|
# File 'lib/filter_rename/filters.rb', line 299
def self.hint; 'Move the text selected by REGEX to TARGET'; end
|
.params ⇒ Object
300
|
# File 'lib/filter_rename/filters.rb', line 300
def self.params; 'REGEX,TARGET'; end
|
Instance Method Details
#filter(params) ⇒ Object
302
303
304
305
306
307
|
# File 'lib/filter_rename/filters.rb', line 302
def filter(params)
regex = Regexp.new(wrap_regex(params[0]), get_config(:ignore_case).to_boolean)
set_string(get_string.scan(regex).pop.to_a.pop, params[1])
str = get_string.gsub(regex, '')
super str
end
|