Class: Solargraph::Source::Chain::Link

Inherits:
Object
  • Object
show all
Includes:
Equality, Logging
Defined in:
lib/solargraph/source/chain/link.rb

Constant Summary

Constants included from Logging

Logging::DEFAULT_LOG_LEVEL, Logging::LOG_LEVELS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

logger

Methods included from Equality

#==, #eql?, #freeze, #hash

Constructor Details

#initialize(word = '<undefined>') ⇒ Link

Returns a new instance of Link.

Parameters:

  • word (String) (defaults to: '<undefined>')


16
17
18
# File 'lib/solargraph/source/chain/link.rb', line 16

def initialize word = '<undefined>'
  @word = word
end

Instance Attribute Details

#last_contextPin::Base

Returns:



13
14
15
# File 'lib/solargraph/source/chain/link.rb', line 13

def last_context
  @last_context
end

#wordString (readonly)

Returns:

  • (String)


10
11
12
# File 'lib/solargraph/source/chain/link.rb', line 10

def word
  @word
end

Instance Method Details

#clone_bodyself

Make a copy of this link unmarked as the head of a chain

Returns:

  • (self)


75
76
77
# File 'lib/solargraph/source/chain/link.rb', line 75

def clone_body
  clone.mark_head(false)
end

#clone_headself

Make a copy of this link marked as the head of a chain

Returns:

  • (self)


68
69
70
# File 'lib/solargraph/source/chain/link.rb', line 68

def clone_head
  clone.mark_head(true)
end

#constant?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/solargraph/source/chain/link.rb', line 35

def constant?
  is_a?(Chain::Constant)
end

#descString

debugging description of contents; not for machine use

Returns:

  • (String)


49
50
51
# File 'lib/solargraph/source/chain/link.rb', line 49

def desc
  word
end

#head?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/solargraph/source/chain/link.rb', line 61

def head?
  @head ||= false
end

#inspectObject



57
58
59
# File 'lib/solargraph/source/chain/link.rb', line 57

def inspect
  "#<#{self.class} - `#{self.desc}`>"
end

#nullable?Boolean

Returns:

  • (Boolean)


79
80
81
# File 'lib/solargraph/source/chain/link.rb', line 79

def nullable?
  false
end

#resolve(api_map, name_pin, locals) ⇒ ::Array<Pin::Base>

Parameters:

Returns:



43
44
45
# File 'lib/solargraph/source/chain/link.rb', line 43

def resolve api_map, name_pin, locals
  []
end

#to_sObject



53
54
55
# File 'lib/solargraph/source/chain/link.rb', line 53

def to_s
  desc
end

#undefined?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/solargraph/source/chain/link.rb', line 31

def undefined?
  word == '<undefined>'
end