Class: Magnetite::Routing::Scope

Inherits:
BasicObject
Defined in:
lib/magnetite/routing/scope.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, router) ⇒ Scope

Returns a new instance of Scope.



5
6
7
8
9
# File 'lib/magnetite/routing/scope.rb', line 5

def initialize(path, router)
  @path     = path
  @router   = router
  @pipeline = nil
end

Instance Method Details

#pipe_through(name) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/magnetite/routing/scope.rb', line 11

def pipe_through(name)
  @pipeline = @router.get_pipeline(name)

  ::Kernel.raise PipelineNotFound.new(name) if @pipeline.nil?

  @pipeline
end