Sha256: 13f7ff274d44ebcda54715cb8e33468f1beee2b6224f26341a656c4a0a93cbb4

Contents?: true

Size: 884 Bytes

Versions: 4

Compression:

Stored size: 884 Bytes

Contents

module Yoda
  module Model
    module TypeExpressions
      class UnknownType < Base
        attr_reader :name

        # @param name [String]
        def initialize(name = 'unknown')
          @name = name
        end

        # @param another [Object]
        def eql?(another)
          another.is_a?(UnknownType)
        end

        def hash
          [self.class.name, name].hash
        end

        # @param path [Path]
        # @return [self]
        def change_root(path)
          self
        end

        # @param registry [Registry]
        # @return [Array<YARD::CodeObjects::Base>]
        def resolve(registry)
          []
        end

        # @return [String]
        def to_s
          'any'
        end

        # @param env [Environment]
        def to_rbs_type(env)
          RBS::Types::Bases::Any.new(location: nil)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
yoda-language-server-0.10.1 lib/yoda/model/type_expressions/unknown_type.rb
yoda-language-server-0.10.0 lib/yoda/model/type_expressions/unknown_type.rb
yoda-language-server-0.9.0 lib/yoda/model/type_expressions/unknown_type.rb
yoda-language-server-0.8.0 lib/yoda/model/type_expressions/unknown_type.rb