class Solargraph::Source::Chain::Link

Attributes

last_context[RW]
word[R]

@return [String]

Public Class Methods

new(word = '<undefined>') click to toggle source
# File lib/solargraph/source/chain/link.rb, line 11
def initialize word = '<undefined>'
  @word = word
end

Public Instance Methods

==(other) click to toggle source
# File lib/solargraph/source/chain/link.rb, line 35
def == other
  self.class == other.class and word == other.word
end
clone_body() click to toggle source

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

@return [self]

# File lib/solargraph/source/chain/link.rb, line 49
def clone_body
  clone.mark_head(false)
end
clone_head() click to toggle source

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

@return [self]

# File lib/solargraph/source/chain/link.rb, line 42
def clone_head
  clone.mark_head(true)
end
constant?() click to toggle source
# File lib/solargraph/source/chain/link.rb, line 19
def constant?
  is_a?(Chain::Constant)
end
head?() click to toggle source
# File lib/solargraph/source/chain/link.rb, line 31
def head?
  @head ||= false
end
nullable?() click to toggle source
# File lib/solargraph/source/chain/link.rb, line 53
def nullable?
  false
end
resolve(api_map, name_pin, locals) click to toggle source

@param api_map [ApiMap] @param name_pin [Pin::Base] @param locals [Array<Pin::Base>] @return [Array<Pin::Base>]

# File lib/solargraph/source/chain/link.rb, line 27
def resolve api_map, name_pin, locals
  []
end
undefined?() click to toggle source
# File lib/solargraph/source/chain/link.rb, line 15
def undefined?
  word == '<undefined>'
end

Protected Instance Methods

mark_head(bool) click to toggle source

Mark whether this link is the head of a chain

@param bool [Boolean] @return [self]

# File lib/solargraph/source/chain/link.rb, line 63
def mark_head bool
  @head = bool
  self
end