Class: Mvmv::Command::Sequencer
- Inherits:
-
Object
- Object
- Mvmv::Command::Sequencer
- Defined in:
- lib/mvmv/command.rb
Instance Method Summary collapse
- #convert(str) ⇒ Object
-
#initialize(n = 1) ⇒ Sequencer
constructor
A new instance of Sequencer.
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 |