Class: FilterRename::Filters::AddNumberFrom

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, #self_targeted?, #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



54
55
56
# File 'lib/filter_rename/filters.rb', line 54

def self.hint
  "Add the number from TARGET to the NTH"
end

.params ⇒ Object



58
59
60
# File 'lib/filter_rename/filters.rb', line 58

def self.params
  "NTH,TARGET"
end

Instance Method Details

#filtered_number(num, _param_num) ⇒ Object



62
63
64
# File 'lib/filter_rename/filters.rb', line 62

def filtered_number(num, _param_num)
  num.to_i + get_string(params[1]).to_i
end