Class: Alf::Optimizer

Inherits:
Object
  • Object
show all
Defined in:
lib/alf/optimizer.rb,
lib/alf/optimizer/project.rb,
lib/alf/optimizer/restrict.rb

Defined Under Namespace

Classes: Base, Project, Restrict, Search

Instance Method Summary collapse

Constructor Details

#initializeOptimizer


4
5
6
# File 'lib/alf/optimizer.rb', line 4

def initialize
  @processors = []
end

Instance Method Details

#call(expr) ⇒ Object


8
9
10
# File 'lib/alf/optimizer.rb', line 8

def call(expr)
  @processors.inject(expr){|c,p| p.call(c) }
end

#register(processor) ⇒ Object


12
13
14
15
# File 'lib/alf/optimizer.rb', line 12

def register(processor)
  @processors << processor
  self
end