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, ComplexType::UniqueType Also known as: full_context



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

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

#locationLocation?

TODO:

Missed nil violation

Returns:



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

def location
  @location
end

Instance Method Details

#binderComplexType, ComplexType::UniqueType



61
62
63
# File 'lib/solargraph/pin/common.rb', line 61

def binder
  @binder || context
end

#closurePin::Closure?

Returns:



28
29
30
31
32
33
34
# File 'lib/solargraph/pin/common.rb', line 28

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

#closure=(value) ⇒ void

This method returns an undefined value.

Parameters:



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

def closure= value
  @closure = value
  # remove cached values generated from closure
  reset_generated!
end

#commentsString

Returns:

  • (String)


66
67
68
# File 'lib/solargraph/pin/common.rb', line 66

def comments
  @comments ||= ''
end

#nameString

Returns:

  • (String)


37
38
39
# File 'lib/solargraph/pin/common.rb', line 37

def name
  @name ||= ''
end

#namespaceString

Returns:

  • (String)


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

def namespace
  context.namespace.to_s
end

#pathString

Returns:

  • (String)


71
72
73
# File 'lib/solargraph/pin/common.rb', line 71

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

#reset_generated!void

This method is abstract.

This method returns an undefined value.



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

#return_typeComplexType

TODO:

redundant with Base#return_type?

Returns:



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

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

#sourceSource?

This method is abstract.

Returns:



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