Module: Solargraph::Pin::Common

Included in:
Base, Conversions
Defined in:
lib/solargraph/pin/common.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextComplexType Also known as: full_context

Returns:



32
33
34
35
# File 'lib/solargraph/pin/common.rb', line 32

def context
  # Get the static context from the nearest namespace
  @context ||= find_context
end

#locationLocation (readonly)

Returns:



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

def location
  @location
end

Instance Method Details

#binderComplexType

Returns:



44
45
46
# File 'lib/solargraph/pin/common.rb', line 44

def binder
  @binder || context
end

#closurePin::Closure?

@sg-ignore Solargraph::Pin::Common#closure return type could not be inferred

Returns:



16
17
18
19
# File 'lib/solargraph/pin/common.rb', line 16

def closure
  Solargraph.assert_or_log(:closure, "Closure not set on #{self.class} #{name.inspect} from #{source.inspect}") unless @closure
  @closure
end

#commentsString

Returns:

  • (String)


49
50
51
# File 'lib/solargraph/pin/common.rb', line 49

def comments
  @comments ||= ''
end

#nameString

Returns:

  • (String)


22
23
24
# File 'lib/solargraph/pin/common.rb', line 22

def name
  @name ||= ''
end

#namespaceString

Returns:

  • (String)


39
40
41
# File 'lib/solargraph/pin/common.rb', line 39

def namespace
  context.namespace.to_s
end

#pathString

Returns:

  • (String)


54
55
56
# File 'lib/solargraph/pin/common.rb', line 54

def path
  @path ||= name.empty? ? context.namespace : "#{context.namespace}::#{name}"
end

#return_typeComplexType

Returns:



27
28
29
# File 'lib/solargraph/pin/common.rb', line 27

def return_type
  @return_type ||= ComplexType::UNDEFINED
end

#sourceSource?

This method is abstract.

Returns:



# File 'lib/solargraph/pin/common.rb', line 6