Class: Solargraph::Source::Chain::Literal
- Defined in:
- lib/solargraph/source/chain/literal.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Link
Instance Method Summary collapse
-
#initialize(type) ⇒ Literal
constructor
A new instance of Literal.
- #resolve(api_map, name_pin, locals) ⇒ Object
- #word ⇒ Object
Methods inherited from Link
#==, #clone_body, #clone_head, #constant?, #head?, #nullable?, #undefined?
Constructor Details
#initialize(type) ⇒ Literal
Returns a new instance of Literal.
12 13 14 15 |
# File 'lib/solargraph/source/chain/literal.rb', line 12 def initialize type @type = type @complex_type = ComplexType.try_parse(type) end |
Instance Method Details
#resolve(api_map, name_pin, locals) ⇒ Object
17 18 19 |
# File 'lib/solargraph/source/chain/literal.rb', line 17 def resolve api_map, name_pin, locals [Pin::ProxyType.anonymous(@complex_type)] end |
#word ⇒ Object
7 8 9 |
# File 'lib/solargraph/source/chain/literal.rb', line 7 def word @word ||= "<#{@type}>" end |