lib/grumlin/step.rb in grumlin-0.10.0 vs lib/grumlin/step.rb in grumlin-0.10.1
- old
+ new
@@ -8,11 +8,21 @@
super(name, *args, previous_step: previous_step)
@pool = pool
end
def next
- @enum ||= toList.to_enum
- @enum.next
+ to_enum.next
+ end
+
+ def hasNext # rubocop:disable Naming/MethodName
+ to_enum.peek
+ true
+ rescue StopIteration
+ false
+ end
+
+ def to_enum
+ @to_enum ||= toList.to_enum
end
def toList
@pool.acquire do |client|
client.write(bytecode)