Class: Enumerator
- Defined in:
- lib/eac_ruby_utils/patches/enumerator/current.rb,
lib/eac_ruby_utils/patches/enumerator/stopped.rb
Instance Method Summary collapse
Instance Method Details
#current(default_value = nil) ⇒ Object
4 5 6 7 8 |
# File 'lib/eac_ruby_utils/patches/enumerator/current.rb', line 4 def current(default_value = nil) peek rescue ::StopIteration default_value end |
#ongoing? ⇒ Boolean
4 5 6 |
# File 'lib/eac_ruby_utils/patches/enumerator/stopped.rb', line 4 def ongoing? !stopped? end |
#stopped? ⇒ Boolean
8 9 10 11 12 13 |
# File 'lib/eac_ruby_utils/patches/enumerator/stopped.rb', line 8 def stopped? peek false rescue ::StopIteration true end |