Class: Solargraph::Pin::ProxyType

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

Instance Attribute Summary

Attributes inherited from Base

#code_object, #location, #name, #path, #return_type, #source

Attributes included from Common

#closure, #location

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#==, #comments, #completion_item_kind, #deprecated?, #directives, #docstring, #filename, #identity, #infer, #inspect, #macros, #maybe_directives?, #nearly?, #probe, #probed?, #proxied?, #proxy, #realize, #symbol_kind, #to_s, #try_merge!, #typify, #variable?

Methods included from Documenting

#documentation

Methods included from Conversions

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

Methods included from Common

#binder, #comments, #name, #namespace, #path, #return_type

Constructor Details

#initialize(return_type: ComplexType::UNDEFINED, **splat) ⇒ ProxyType

Returns a new instance of ProxyType.

Parameters:

  • return_type (ComplexType) (defaults to: ComplexType::UNDEFINED)


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

def initialize return_type: ComplexType::UNDEFINED, **splat
  super(**splat)
  @return_type = return_type
end

Class Method Details

.anonymous(return_type) ⇒ ProxyType

Parameters:

Returns:



18
19
20
21
22
23
24
25
26
# File 'lib/solargraph/pin/proxy_type.rb', line 18

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)
  ProxyType.new(
    closure: Solargraph::Pin::Namespace.new(name: namespace), return_type: return_type
  )
end

Instance Method Details

#contextObject



12
13
14
# File 'lib/solargraph/pin/proxy_type.rb', line 12

def context
  @return_type
end