Sha256: 519cb174b1f502f7495800a22aef0b21968d562cbbed3c5bd156fb6e9992e5f0

Contents?: true

Size: 807 Bytes

Versions: 26

Compression:

Stored size: 807 Bytes

Contents

# frozen_string_literal: true
# typed: true

module T::Types
  # Modeling AttachedClass properly at runtime would require additional
  # tracking, so at runtime we permit all values and rely on the static checker.
  # As AttachedClass is modeled statically as a type member on every singleton
  # class, this is consistent with the runtime behavior for all type members.
  class AttachedClassType < Base

    def initialize(); end

    # @override Base
    def name
      "AttachedClass"
    end

    # @override Base
    def valid?(obj)
      true
    end

    # @override Base
    private def subtype_of_single?(other)
      case other
      when AttachedClassType
        true
      else
        false
      end
    end

    module Private
      INSTANCE = AttachedClassType.new.freeze
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
sorbet-runtime-0.5.5883 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5881 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5880 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5879 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5878 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5877 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5873 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5871 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5870 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5869 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5868 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5867 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5866 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5865 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5863 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5862 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5859 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5858 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5855 lib/types/types/attached_class.rb
sorbet-runtime-0.5.5851 lib/types/types/attached_class.rb