Module: Granite::Routing::Declarer

Defined in:
lib/granite/routing/declarer.rb

Class Method Summary collapse

Class Method Details

.declare(routing, route, **options) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/granite/routing/declarer.rb', line 5

def declare(routing, route, **options)
  routing.match route.path,
                via: :all,
                **options,
                to: dispatcher,
                as: route.as,
                granite_action: route.action_path,
                granite_projector: route.projector_name
end

.dispatcherObject



15
16
17
# File 'lib/granite/routing/declarer.rb', line 15

def dispatcher
  @dispatcher ||= Dispatcher.new
end

.reset_dispatcherObject



19
20
21
# File 'lib/granite/routing/declarer.rb', line 19

def reset_dispatcher
  dispatcher.reset!
end