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.6386 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6385 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6382 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6380 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6376 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6374 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6373 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6371 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6370 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6366 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6363 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6362 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6361 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6360 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6357 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6353 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6352 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6351 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6349 lib/types/types/typed_range.rb
sorbet-runtime-0.5.6346 lib/types/types/typed_range.rb