Class: Enumerator

Inherits:
Object
  • Object
show all
Defined in:
lib/lazer/lazy_enumerable.rb

Instance Method Summary collapse

Instance Method Details

#better_nextObject



119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/lazer/lazy_enumerable.rb', line 119

def better_next
  if @no_more
    raise StopIteration
  else
    begin
      self.next
    rescue StopIteration
      @no_more = true
      raise StopIteration
    end
  end
end