Class: Tankobon::SequenceTransform
- Defined in:
- lib/tankobon/transform.rb
Instance Method Summary collapse
-
#initialize(seq = -1,, padding = 5) ⇒ SequenceTransform
constructor
A new instance of SequenceTransform.
- #pad(num) ⇒ Object
- #transform(input) ⇒ Object
Methods inherited from Transform
Constructor Details
#initialize(seq = -1,, padding = 5) ⇒ SequenceTransform
Returns a new instance of SequenceTransform.
13 14 15 16 |
# File 'lib/tankobon/transform.rb', line 13 def initialize(seq=-1, padding=5) @seq = seq @padding = padding end |
Instance Method Details
#pad(num) ⇒ Object
18 19 20 |
# File 'lib/tankobon/transform.rb', line 18 def pad(num) "%0#{@padding}d" % num end |
#transform(input) ⇒ Object
22 23 24 |
# File 'lib/tankobon/transform.rb', line 22 def transform(input) pad(@seq += 1) end |