Class: FilterRename::Filters::Set

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

.hintObject



645
# File 'lib/filter_rename/filters.rb', line 645

def self.hint; 'Set the current or an optional TARGET with TEXT'; end

.paramsObject



646
# File 'lib/filter_rename/filters.rb', line 646

def self.params; 'TEXT[,TARGET]'; end

Instance Method Details

#filter(params) ⇒ Object



648
649
650
651
652
653
654
655
656
657
# File 'lib/filter_rename/filters.rb', line 648

def filter(params)
  if params[1].nil?
    str = params[0]
  else
    set_string(params[0], params[1].delete(':<>'))
    str = get_string
  end

  super str
end