Class: Solargraph::Source::Chain::Link
- Inherits:
-
Object
- Object
- Solargraph::Source::Chain::Link
show all
- Includes:
- Equality, Logging
- Defined in:
- lib/solargraph/source/chain/link.rb
Direct Known Subclasses
BlockSymbol, BlockVariable, Call, ClassVariable, Constant, GlobalVariable, Head, If, InstanceVariable, Literal, Or, Variable
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
log_level, logger
Methods included from Equality
#==, #eql?, #freeze, #hash
Constructor Details
#initialize(word = '<undefined>') ⇒ Link
Returns a new instance of Link.
16
17
18
|
# File 'lib/solargraph/source/chain/link.rb', line 16
def initialize word = '<undefined>'
@word = word
end
|
Instance Attribute Details
13
14
15
|
# File 'lib/solargraph/source/chain/link.rb', line 13
def last_context
@last_context
end
|
#word ⇒ String
10
11
12
|
# File 'lib/solargraph/source/chain/link.rb', line 10
def word
@word
end
|
Instance Method Details
#clone_body ⇒ self
Make a copy of this link unmarked as the head of a chain
58
59
60
|
# File 'lib/solargraph/source/chain/link.rb', line 58
def clone_body
clone.mark_head(false)
end
|
#clone_head ⇒ self
Make a copy of this link marked as the head of a chain
51
52
53
|
# File 'lib/solargraph/source/chain/link.rb', line 51
def clone_head
clone.mark_head(true)
end
|
#constant? ⇒ Boolean
24
25
26
|
# File 'lib/solargraph/source/chain/link.rb', line 24
def constant?
is_a?(Chain::Constant)
end
|
#desc ⇒ String
debugging description of contents; not for machine use
69
70
71
|
# File 'lib/solargraph/source/chain/link.rb', line 69
def desc
word
end
|
#head? ⇒ Boolean
44
45
46
|
# File 'lib/solargraph/source/chain/link.rb', line 44
def head?
@head ||= false
end
|
#inspect ⇒ Object
40
41
42
|
# File 'lib/solargraph/source/chain/link.rb', line 40
def inspect
"#<#{self.class} - `#{desc}`>"
end
|
#nullable? ⇒ Boolean
62
63
64
|
# File 'lib/solargraph/source/chain/link.rb', line 62
def nullable?
false
end
|
#resolve(api_map, name_pin, locals) ⇒ ::Array<Pin::Base>
32
33
34
|
# File 'lib/solargraph/source/chain/link.rb', line 32
def resolve api_map, name_pin, locals
[]
end
|
#to_s ⇒ Object
36
37
38
|
# File 'lib/solargraph/source/chain/link.rb', line 36
def to_s
desc
end
|
#undefined? ⇒ Boolean
20
21
22
|
# File 'lib/solargraph/source/chain/link.rb', line 20
def undefined?
word == '<undefined>'
end
|