Class: Rack::Delegate::Dispatcher

Inherits:
Struct
  • Object
show all
Defined in:
lib/rack/delegate/dispatcher.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#actionsObject

Returns the value of attribute actions

Returns:

  • (Object)

    the current value of actions



3
4
5
# File 'lib/rack/delegate/dispatcher.rb', line 3

def actions
  @actions
end

Class Method Details

.configure(&block) ⇒ Object



4
5
6
# File 'lib/rack/delegate/dispatcher.rb', line 4

def self.configure(&block)
  new(Configuration.from_block(&block))
end

Instance Method Details

#dispatch(request) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/rack/delegate/dispatcher.rb', line 8

def dispatch(request)
  catch :dispatched do
    actions.each do |action|
      action.dispatch(request)
    end

    nil
  end
end