Class: FilterRename::Filters::CopyTo
Class Method Summary
collapse
Instance Method Summary
collapse
#filter
#current_target, #filter, #get_config, #get_string, #get_words, #initialize, #match?, #set_config, #set_string, #wrap_regex
Class Method Details
.hint ⇒ Object
298
299
300
|
# File 'lib/filter_rename/filters.rb', line 298
def self.hint
"Copy the text selected by REGEX to TARGET"
end
|
.params ⇒ Object
302
303
304
|
# File 'lib/filter_rename/filters.rb', line 302
def self.params
"REGEX,TARGET"
end
|
Instance Method Details
#filtered_regexp(matches, params) ⇒ Object
306
307
308
309
310
311
312
313
|
# File 'lib/filter_rename/filters.rb', line 306
def filtered_regexp(matches, params)
if matches.length > 2
matches[1..-1].each_with_index { |x, i| set_string(x, "#{params[1]}_#{i.next}") }
else
set_string(matches[1], params[1])
end
matches[0]
end
|