Class: Mvmv::Command::Sequencer

Inherits:
Object
  • Object
show all
Defined in:
lib/mvmv/command.rb

Instance Method Summary collapse

Constructor Details

#initialize(n = 1) ⇒ Sequencer

Returns a new instance of Sequencer.



4
5
6
# File 'lib/mvmv/command.rb', line 4

def initialize n = 1
  @n = n - 1
end

Instance Method Details

#convert(str) ⇒ Object



8
9
10
11
# File 'lib/mvmv/command.rb', line 8

def convert str
  @n += 1
  str.gsub(/#+/) { |x| @n.to_s.rjust(x.length, '0') }
end