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

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

Instance Attribute Summary

Attributes inherited from Link

#last_context

Instance Method Summary collapse

Methods inherited from Link

#==, #clone_body, #clone_head, #constant?, #head?, #nullable?, #undefined?

Constructor Details

#initialize(type, splatted = false) ⇒ Hash

Returns a new instance of Hash.

Parameters:

  • type (String)
  • splatted (Boolean) (defaults to: false)


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

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

Instance Method Details

#resolve(api_map, name_pin, locals) ⇒ Object



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

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

#splatted?Boolean

Returns:

  • (Boolean)


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

def splatted?
  @splatted
end

#wordObject



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

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