Class: Rage::Router::DSL

Inherits:
Object
  • Object
show all
Defined in:
lib/rage/router/dsl.rb

Defined Under Namespace

Classes: Handler

Instance Method Summary collapse

Constructor Details

#initialize(router) ⇒ DSL

Returns a new instance of DSL.



9
10
11
# File 'lib/rage/router/dsl.rb', line 9

def initialize(router)
  @router = router
end

Instance Method Details

#draw(&block) ⇒ Object



13
14
15
16
17
# File 'lib/rage/router/dsl.rb', line 13

def draw(&block)
  Handler.new(@router).instance_eval(&block)
  # propagate route definitions to Rails for `rails routes` to work
  Rails.application.routes.draw(&block) if Rage.config.internal.rails_mode
end