Class: Solargraph::Source::Chain::Or

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

Instance Attribute Summary

Attributes inherited from Link

#last_context

Instance Method Summary collapse

Methods inherited from Link

#==, #constant?, #undefined?

Constructor Details

#initialize(links) ⇒ Or


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

def initialize links
  @links = links
end

Instance Method Details

#resolve(api_map, name_pin, locals) ⇒ Object


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

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(', ')))]
end

#wordObject


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

def word
  '<or>'
end