Sha256: 3c5660fc91805eeb81661a8ac2f0286974b9c8ac7b061745dd3fec7be25027cc

Contents?: true

Size: 478 Bytes

Versions: 232

Compression:

Stored size: 478 Bytes

Contents

# frozen_string_literal: true
# typed: true

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

    def underlying_class
      Hash
    end

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

    # @override Base
    def recursively_valid?(obj)
      obj.is_a?(Range) && super
    end

    # @override Base
    def valid?(obj)
      obj.is_a?(Range)
    end

    def new(*args)
      T.unsafe(Range).new(*args)
    end
  end
end

Version data entries

232 entries across 232 versions & 1 rubygems

Version Path
sorbet-runtime-0.5.6426 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6425 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6424 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6423 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6418 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6415 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6412 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6408 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6407 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6405 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6403 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6401 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6400 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6398 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6397 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6395 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6393 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6391 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6389 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6388 lib/types/types/typed_range.rb