Sha256: ef61dc9b5965abba417daa3d4471f3f9db3f651f05e3bdbb502c5ad324f2a968

Contents?: true

Size: 435 Bytes

Versions: 238

Compression:

Stored size: 435 Bytes

Contents

# frozen_string_literal: true
# typed: true

module T::Types
  class TypedEnumerator < TypedEnumerable
    attr_reader :type

    # @override Base
    def name
      "T::Enumerator[#{@type.name}]"
    end

    # @override Base
    def valid?(obj)
      obj.is_a?(Enumerator) && super
    end

    def new(*args, &blk) # rubocop:disable PrisonGuard/BanBuiltinMethodOverride
      T.unsafe(Enumerator).new(*args, &blk)
    end
  end
end

Version data entries

238 entries across 238 versions & 1 rubygems

Version Path
sorbet-runtime-0.4.4539 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4538 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4537 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4536 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4535 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4534 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4533 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4532 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4531 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4530 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4529 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4528 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4527 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4526 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4525 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4524 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4523 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4521 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4522 lib/types/types/typed_enumerator.rb
sorbet-runtime-0.4.4519 lib/types/types/typed_enumerator.rb