Class: FilterRename::Filters::MoveNumberTo

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 inherited from FilterRename::FilterNumber

calculator

Methods included from IndexedParams

#filter, #indexed_params, #indexes, #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

.hint ⇒ Object



561
562
563
# File 'lib/filter_rename/filters.rb', line 561

def self.hint
  "Move the NTH number to TARGET overwriting it"
end

.params ⇒ Object



565
566
567
# File 'lib/filter_rename/filters.rb', line 565

def self.params
  "NTH,TARGET"
end

Instance Method Details

#filtered_number(num, _param_num) ⇒ Object



573
574
575
576
# File 'lib/filter_rename/filters.rb', line 573

def filtered_number(num, _param_num)
  set_string(num, params[1])
  ""
end

#self_targeted? ⇒ Boolean

Returns:



569
570
571
# File 'lib/filter_rename/filters.rb', line 569

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