Class: Solargraph::Source::Chain::Array

Inherits:
Literal show all
Defined in:
lib/solargraph/source/chain/array.rb

Constant Summary

Constants included from Logging

Logging::DEFAULT_LOG_LEVEL, Logging::LOG_LEVELS

Instance Attribute Summary

Attributes inherited from Literal

#value

Attributes inherited from Link

#last_context

Instance Method Summary collapse

Methods inherited from Link

#clone_body, #clone_head, #constant?, #desc, #head?, #inspect, #nullable?, #to_s, #undefined?

Methods included from Logging

log_level, logger

Methods included from Equality

#==, #eql?, #equality_fields, #freeze, #hash

Constructor Details

#initialize(children, node) ⇒ Array

Returns a new instance of Array.

Parameters:

  • children (::Array<Chain>)
  • node (Parser::AST::Node)


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

def initialize children, node
  super('::Array', node)
  @children = children
end

Instance Method Details

#resolve(api_map, name_pin, locals) ⇒ Object

Parameters:



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

def resolve api_map, name_pin, locals
  type = ComplexType::UniqueType.new('Array', rooted: true)
  [Pin::ProxyType.anonymous(type, source: :chain)]
end

#wordObject



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

def word
  @word ||= "<#{@type}>"
end