Class: Solargraph::Source::Chain::If
- Defined in:
- lib/solargraph/source/chain/if.rb
Constant Summary
Constants included from Logging
Logging::DEFAULT_LOG_LEVEL, Logging::LOG_LEVELS
Instance Attribute Summary
Attributes inherited from Link
Instance Method Summary collapse
-
#initialize(links) ⇒ If
constructor
A new instance of If.
- #resolve(api_map, name_pin, locals) ⇒ Object
- #word ⇒ Object
Methods inherited from Link
#clone_body, #clone_head, #constant?, #desc, #head?, #inspect, #nullable?, #to_s, #undefined?
Methods included from Logging
Methods included from Equality
Constructor Details
#initialize(links) ⇒ If
Returns a new instance of If.
12 13 14 |
# File 'lib/solargraph/source/chain/if.rb', line 12 def initialize links @links = links end |
Instance Method Details
#resolve(api_map, name_pin, locals) ⇒ Object
21 22 23 24 |
# File 'lib/solargraph/source/chain/if.rb', line 21 def resolve api_map, name_pin, locals types = @links.map { |link| link.infer(api_map, name_pin, locals) } [Solargraph::Pin::ProxyType.anonymous(Solargraph::ComplexType.try_parse(types.map(&:tag).uniq.join(', ')), source: :chain)] end |
#word ⇒ Object
7 8 9 |
# File 'lib/solargraph/source/chain/if.rb', line 7 def word '<if>' end |