Sha256: 35949391ad1772c6058c09b96b9faf8ec567864e807cfe748e51665232976f61

Contents?: true

Size: 810 Bytes

Versions: 239

Compression:

Stored size: 810 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
      "T.attached_class"
    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

239 entries across 239 versions & 1 rubygems

Version Path
sorbet-runtime-0.5.9172 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9167 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9163 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9161 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9158 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9155 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9154 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9152 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9151 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9147 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9139 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9133 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9130 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9125 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9120 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9115 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9112 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9105 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9104 lib/types/types/attached_class.rb
sorbet-runtime-0.5.9103 lib/types/types/attached_class.rb