class FilterRename::Filters::Wrap

Public Class Methods

hint() click to toggle source
# File lib/filter_rename/filters.rb, line 631
def self.hint; 'Wrap the text matching REGEX with SEPARATOR1 and SEPARATOR2'; end
params() click to toggle source
# File lib/filter_rename/filters.rb, line 632
def self.params; 'REGEX,SEPARATOR1,SEPARATOR2'; end

Public Instance Methods

filter(params) click to toggle source
Calls superclass method FilterRename::FilterBase#filter
# File lib/filter_rename/filters.rb, line 634
def filter(params)
  params[0] = "(#{params[0]})" unless params[0] =~ /[()]+/
  regexp = Regexp.new("(#{params[0]})", get_config(:ignore_case).to_boolean)
  super get_string.gsub(regexp, "#{params[1]}\\1#{params[2]}")
end