Class: Solargraph::Source::Chain::Or
- Defined in:
- lib/solargraph/source/chain/or.rb
Instance Attribute Summary
Attributes inherited from Link
Instance Method Summary collapse
-
#initialize(links) ⇒ Or
constructor
A new instance of Or.
- #resolve(api_map, name_pin, locals) ⇒ Object
- #word ⇒ Object
Methods inherited from Link
#==, #clone_body, #clone_head, #constant?, #head?, #nullable?, #undefined?
Constructor Details
#initialize(links) ⇒ Or
Returns a new instance of Or.
12 13 14 |
# File 'lib/solargraph/source/chain/or.rb', line 12 def initialize links @links = links end |
Instance Method Details
#resolve(api_map, name_pin, locals) ⇒ Object
16 17 18 19 |
# File 'lib/solargraph/source/chain/or.rb', line 16 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 |
#word ⇒ Object
7 8 9 |
# File 'lib/solargraph/source/chain/or.rb', line 7 def word '<or>' end |