Class: Solargraph::Source::Chain::Literal

Inherits:
Link
  • Object
show all
Defined in:
lib/solargraph/source/chain/literal.rb

Instance Attribute Summary

Attributes inherited from Link

#last_context

Instance Method Summary collapse

Methods inherited from Link

#==, #constant?, #undefined?

Constructor Details

#initialize(type) ⇒ Literal

Returns a new instance of Literal

Parameters:

  • type (String)

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

def initialize type
  @type = type
  @complex_type = ComplexType.try_parse(type).first
end

Instance Method Details

#resolve(api_map, name_pin, locals) ⇒ Object


15
16
17
# File 'lib/solargraph/source/chain/literal.rb', line 15

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

#wordObject


5
6
7
# File 'lib/solargraph/source/chain/literal.rb', line 5

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