Class: Enumerator

Inherits:
Object
  • Object
show all
Defined in:
lib/rencode/decoder.rb

Overview

a little monkey-patching to add enumerator next-N, where N is a number

Instance Method Summary collapse

Instance Method Details

#nextn(num) ⇒ Object



5
6
7
# File 'lib/rencode/decoder.rb', line 5

def nextn num
  [].tap {|a| num.times {|i| a << send('next') } }
end