Class: FilterRename::Filters::AppendNumberTo

Inherits:
FilterRename::FilterNumber show all
Defined in:
lib/filter_rename/filters.rb

Instance Attribute Summary

Attributes included from IndexedParams

#items, #params, #params_expanded

Class Method Summary collapse

Instance Method Summary collapse

Methods included from IndexedParams

#filter, #get_indexes, #indexed_params, #normalize_index, #string_to_loop

Methods inherited from FilterRename::FilterBase

#current_target, #filter, #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



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

def self.hint; 'Append the NTH number to TARGET'; end

.paramsObject



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

def self.params; 'NTH,TARGET'; end

Instance Method Details

#filtered_number(num, param_num) ⇒ Object



102
103
104
105
106
# File 'lib/filter_rename/filters.rb', line 102

def filtered_number(num, param_num)
  str = get_string(params[1])
  set_string("#{str}#{num}", params[1])
  num
end

#self_targeted?Boolean

Returns:



98
99
100
# File 'lib/filter_rename/filters.rb', line 98

def self_targeted?
  params[-1] == current_target
end