Class: Solargraph::Source::Chain::Link
- Inherits:
-
Object
- Object
- Solargraph::Source::Chain::Link
show all
- Defined in:
- lib/solargraph/source/chain/link.rb
Direct Known Subclasses
BlockSymbol, BlockVariable, Call, ClassVariable, Constant, GlobalVariable, Head, If, InstanceVariable, Literal, Or, Variable
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(word = '<undefined>') ⇒ Link
Returns a new instance of Link.
14
15
16
|
# File 'lib/solargraph/source/chain/link.rb', line 14
def initialize word = '<undefined>'
@word = word
end
|
Instance Attribute Details
11
12
13
|
# File 'lib/solargraph/source/chain/link.rb', line 11
def last_context
@last_context
end
|
#word ⇒ String
8
9
10
|
# File 'lib/solargraph/source/chain/link.rb', line 8
def word
@word
end
|
Instance Method Details
#==(other) ⇒ Object
42
43
44
|
# File 'lib/solargraph/source/chain/link.rb', line 42
def == other
self.class == other.class and word == other.word
end
|
#clone_body ⇒ self
Make a copy of this link unmarked as the head of a chain
56
57
58
|
# File 'lib/solargraph/source/chain/link.rb', line 56
def clone_body
clone.mark_head(false)
end
|
#clone_head ⇒ self
Make a copy of this link marked as the head of a chain
49
50
51
|
# File 'lib/solargraph/source/chain/link.rb', line 49
def clone_head
clone.mark_head(true)
end
|
#constant? ⇒ Boolean
22
23
24
|
# File 'lib/solargraph/source/chain/link.rb', line 22
def constant?
is_a?(Chain::Constant)
end
|
#desc ⇒ Object
debugging description of contents; not for machine use
65
66
67
|
# File 'lib/solargraph/source/chain/link.rb', line 65
def desc
word
end
|
#head? ⇒ Boolean
38
39
40
|
# File 'lib/solargraph/source/chain/link.rb', line 38
def head?
@head ||= false
end
|
#inspect ⇒ Object
34
35
36
|
# File 'lib/solargraph/source/chain/link.rb', line 34
def inspect
"#{self.class} #{word}"
end
|
#nullable? ⇒ Boolean
60
61
62
|
# File 'lib/solargraph/source/chain/link.rb', line 60
def nullable?
false
end
|
#resolve(api_map, name_pin, locals) ⇒ ::Array<Pin::Base>
30
31
32
|
# File 'lib/solargraph/source/chain/link.rb', line 30
def resolve api_map, name_pin, locals
[]
end
|
#undefined? ⇒ Boolean
18
19
20
|
# File 'lib/solargraph/source/chain/link.rb', line 18
def undefined?
word == '<undefined>'
end
|