Class: Solargraph::Pin::ProxyType

Inherits:
Base
  • Object
show all
Defined in:
lib/solargraph/pin/proxy_type.rb

Instance Attribute Summary

Attributes inherited from Base

#kind, #location, #name, #namespace

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#==, #comments, #completion_item_kind, #deprecated?, #directives, #docstring, #filename, #infer, #macros, #maybe_directives?, #nearly?, #return_complex_type, #return_type, #symbol_kind, #to_s, #try_merge!, #variable?

Methods included from Documenting

#documentation

Methods included from Conversions

#completion_item, #detail, #link_documentation, #reset_conversions, #resolve_completion_item, #signature_help

Constructor Details

#initialize(location, namespace, name, return_type) ⇒ ProxyType

Returns a new instance of ProxyType.

Parameters:



8
9
10
11
# File 'lib/solargraph/pin/proxy_type.rb', line 8

def initialize location, namespace, name, return_type
  super(location, namespace, name, '')
  @return_complex_type = return_type
end

Class Method Details

.anonymous(return_type) ⇒ ProxyType

Parameters:

Returns:



27
28
29
30
31
32
# File 'lib/solargraph/pin/proxy_type.rb', line 27

def self.anonymous return_type
  parts = return_type.namespace.split('::')
  namespace = parts[0..-2].join('::').to_s
  name = parts.last.to_s
  ProxyType.new(nil, namespace, name, return_type)
end

Instance Method Details

#contextObject



21
22
23
# File 'lib/solargraph/pin/proxy_type.rb', line 21

def context
  @return_complex_type
end

#pathObject



13
14
15
16
17
18
19
# File 'lib/solargraph/pin/proxy_type.rb', line 13

def path
  @path ||= begin
    result = namespace.to_s
    result += '::' unless result.empty? or name.to_s.empty?
    result += name.to_s
  end
end