Class: FilterRename::Filters::SetWhen
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
499
|
# File 'lib/filter_rename/filters.rb', line 499
def self.hint; 'Set the current or given TARGET to TEXT when REGEX is matched'; end
|
.params ⇒ Object
500
|
# File 'lib/filter_rename/filters.rb', line 500
def self.params; 'REGEX,TEXT[,TARGET]'; end
|
Instance Method Details
#filter(params) ⇒ Object
502
503
504
505
506
|
# File 'lib/filter_rename/filters.rb', line 502
def filter(params)
target = params[-1] if params.length.odd?
set_string(params[1], target) if get_string =~ Regexp.new(params[0], get_config(:ignore_case).to_boolean)
super get_string
end
|