Class: Moku::Pipeline::Pipeline

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/moku/pipeline/pipeline.rb

Overview

Pipelines represent the highest level processes that the application performs. Pipelines tie everything together.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Pipeline

Returns a new instance of Pipeline.


33
34
35
# File 'lib/moku/pipeline/pipeline.rb', line 33

def initialize(command)
  @command = command
end

Class Method Details

.for(target) ⇒ Object


11
12
13
14
# File 'lib/moku/pipeline/pipeline.rb', line 11

def self.for(target)
  registry.find {|candidate| candidate.handles?(target) }
    .new(target)
end

.handles?(command) ⇒ Boolean

Returns:

  • (Boolean)

24
25
26
# File 'lib/moku/pipeline/pipeline.rb', line 24

def self.handles?(command)
  true
end

.register(candidate) ⇒ Object


20
21
22
# File 'lib/moku/pipeline/pipeline.rb', line 20

def self.register(candidate)
  registry.unshift(candidate)
end

.registryObject


16
17
18
# File 'lib/moku/pipeline/pipeline.rb', line 16

def self.registry
  @@registry ||= []
end

Instance Method Details

#callObject


37
38
39
# File 'lib/moku/pipeline/pipeline.rb', line 37

def call
  logger.error "Unrecognized command"
end