Class: FilterRename::Filters::JoinNumbers

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

.hintObject



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

def self.hint; 'Join the words NTH1 and NTH2 and replace the NTH3 number with it'; end

.paramsObject



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

def self.params; 'NTH1,NTH2,NTH3'; end

Instance Method Details

#filtered_number(number, param_num) ⇒ Object



337
338
339
340
341
342
343
344
345
346
347
348
349
350
# File 'lib/filter_rename/filters.rb', line 337

def filtered_number(number, param_num)
  case param_num
  when 1
    @number = number
    number = nil
  when params_expanded.length
    number = @number
  else
    @number += number
    number = nil
  end

  number
end

#indexed_paramsObject



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

def indexed_params; 3; end