Class: Wool::SexpAnalysis::Protocols::Base

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/wool/analysis/protocols.rb

Overview

The base class for all protocols.

Direct Known Subclasses

ClassProtocol, UnionProtocol

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object

Compares the protocol to another protocol by comparing their signatures list (sorted).



24
25
26
# File 'lib/wool/analysis/protocols.rb', line 24

def <=>(other)
  self.signatures.sort <=> other.signatures.sort
end

#signaturesArray<Signature>

Returns the list of all known signatures that this protocol responds to.

Returns:

  • (Array<Signature>)

    the supported signatures for this protocol.

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/wool/analysis/protocols.rb', line 18

def signatures
  raise NotImplementedError.new('You must implement #signatures yourself.')
end