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.



45
46
47
# File 'lib/seafoam/passes.rb', line 45

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

Class Method Details

.inherited(pass) ⇒ Object



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

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

Instance Method Details

#applies?(_graph) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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

def applies?(_graph)
  raise NotImplementedError
end

#apply(_graph) ⇒ Object

Raises:

  • (NotImplementedError)


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

def apply(_graph)
  raise NotImplementedError
end