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



864
865
866
# File 'lib/filter_rename/filters.rb', line 864

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

.paramsObject



868
869
870
# File 'lib/filter_rename/filters.rb', line 868

def self.params
  "TEXT[,TARGET]"
end

Instance Method Details

#filter(params) ⇒ Object



872
873
874
875
876
877
878
879
880
881
# File 'lib/filter_rename/filters.rb', line 872

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