Class: Solargraph::Source::Chain::Hash

Inherits:
Literal show all
Defined in:
lib/solargraph/source/chain/hash.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

logger

Methods included from Equality

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

Constructor Details

#initialize(type, node, splatted = false) ⇒ Hash

Returns a new instance of Hash.

Parameters:

  • type (String)
  • node (Parser::AST::Node)
  • splatted (Boolean) (defaults to: false)


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

def initialize type, node, splatted = false
  super(type, node)
  @splatted = splatted
end

Instance Method Details

#resolve(api_map, name_pin, locals) ⇒ Object



24
25
26
# File 'lib/solargraph/source/chain/hash.rb', line 24

def resolve api_map, name_pin, locals
  [Pin::ProxyType.anonymous(@complex_type)]
end

#splatted?Boolean

Returns:

  • (Boolean)


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

def splatted?
  @splatted
end

#wordObject



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

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