Class: Wool::SexpAnalysis::Protocols::UnionProtocol
- Defined in:
- lib/wool/analysis/protocols.rb
Overview
This is a simple protocol whose signature set is just the union of the signature sets of its constituent protocols.
Instance Method Summary collapse
-
#initialize(constituents) ⇒ UnionProtocol
constructor
Initializes the Union protocol to a set of constituent protocols.
-
#signatures ⇒ Array<Signature>
Returns the list of all known signatures that this protocol responds to, which is the union of all the constituent protocols.
Methods inherited from Base
Constructor Details
#initialize(constituents) ⇒ UnionProtocol
Initializes the Union protocol to a set of constituent protocols.
36 37 38 |
# File 'lib/wool/analysis/protocols.rb', line 36 def initialize(constituents) @protocols = constituents end |
Instance Method Details
#signatures ⇒ Array<Signature>
Returns the list of all known signatures that this protocol responds to, which is the union of all the constituent protocols.
44 45 46 |
# File 'lib/wool/analysis/protocols.rb', line 44 def signatures @protocols.map(&:signatures).inject(:|) end |