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.

Parameters:

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


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

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

Instance Attribute Details

#last_contextPin::Base

Returns:



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

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



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

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)


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

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)


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

def clone_head
  clone.mark_head(true)
end

#constant?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/solargraph/source/chain/link.rb', line 22

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

#head?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/solargraph/source/chain/link.rb', line 38

def head?
  @head ||= false
end

#inspectObject



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

def inspect
  "#{self.class} #{word}"
end

#nullable?Boolean

Returns:

  • (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>

Parameters:

Returns:



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

def resolve api_map, name_pin, locals
  []
end

#undefined?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/solargraph/source/chain/link.rb', line 18

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