Sha256: b3bac48c9680de4f13d93a5de48abdb77141a0637c3f449993c65b9d102d30e0

Contents?: true

Size: 145 Bytes

Versions: 299

Compression:

Stored size: 145 Bytes

Contents

# frozen_string_literal: true

class Enumerator
  def current(default_value = nil)
    peek
  rescue ::StopIteration
    default_value
  end
end

Version data entries

299 entries across 299 versions & 4 rubygems

Version Path
eac_ruby_utils-0.123.0 lib/eac_ruby_utils/patches/enumerator/current.rb
eac_ruby_utils-0.121.0 lib/eac_ruby_utils/patches/enumerator/current.rb
eac_ruby_utils-0.120.0 lib/eac_ruby_utils/patches/enumerator/current.rb
eac_tools-0.76.1 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb
eac_tools-0.76.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb
eac_tools-0.75.2 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb
eac_ruby_utils-0.119.2 lib/eac_ruby_utils/patches/enumerator/current.rb
eac_tools-0.75.1 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb
eac_tools-0.75.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb
eac_ruby_utils-0.119.1 lib/eac_ruby_utils/patches/enumerator/current.rb
eac_tools-0.74.1 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb
eac_tools-0.74.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb
eac_tools-0.73.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb
eac_ruby_utils-0.119.0 lib/eac_ruby_utils/patches/enumerator/current.rb
eac_tools-0.72.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb
eac_ruby_utils-0.118.1 lib/eac_ruby_utils/patches/enumerator/current.rb
eac_ruby_utils-0.118.0 lib/eac_ruby_utils/patches/enumerator/current.rb
eac_tools-0.70.1 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb
eac_tools-0.70.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb
eac_tools-0.69.1 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb