Class: Seafoam::Pass

Inherits:
Object
  • Object
show all
Defined in:
lib/seafoam/passes.rb

Overview

The base class for all passes. You must subclass this to be recognized as an pass.

Constant Summary collapse

SUBCLASSES =
[]

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Pass

Returns a new instance of Pass.



49
50
51
# File 'lib/seafoam/passes.rb', line 49

def initialize(options = {})
  @options = options
end

Class Method Details

.inherited(pass) ⇒ Object



62
63
64
65
# File 'lib/seafoam/passes.rb', line 62

def inherited(pass)
  super
  SUBCLASSES.push(pass)
end

Instance Method Details

#applies?(_graph) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


53
54
55
# File 'lib/seafoam/passes.rb', line 53

def applies?(_graph)
  raise NotImplementedError
end

#apply(_graph) ⇒ Object

Raises:

  • (NotImplementedError)


57
58
59
# File 'lib/seafoam/passes.rb', line 57

def apply(_graph)
  raise NotImplementedError
end