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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Link.



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

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

Instance Attribute Details

#last_contextObject

Returns the value of attribute last_context.



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

def last_context
  @last_context
end

#wordString (readonly)

Returns:

  • (String)


8
9
10
# File 'lib/solargraph/source/chain/link.rb', line 8

def word
  @word
end

Instance Method Details

#==(other) ⇒ Object



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

def == other
  self.class == other.class and word == other.word
end

#clone_bodyself

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

Returns:

  • (self)


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

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)


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

def clone_head
  clone.mark_head(true)
end

#constant?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/solargraph/source/chain/link.rb', line 20

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

#head?Boolean

Returns:

  • (Boolean)


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

def head?
  @head ||= false
end

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

Parameters:

Returns:



28
29
30
# File 'lib/solargraph/source/chain/link.rb', line 28

def resolve api_map, name_pin, locals
  []
end

#undefined?Boolean

Returns:

  • (Boolean)


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

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