class Para::Plugins::Routes

Attributes

router[R]

Public Class Methods

new(router) click to toggle source
# File lib/para/plugins/routes.rb, line 6
def initialize(router)
  @router = router
end

Public Instance Methods

plugin(identifier, &block) click to toggle source
# File lib/para/plugins/routes.rb, line 10
def plugin(identifier, &block)
  # Store router reference in closure to allow accessing it from
  # inside the below block
  router = self.router

  router.instance_eval do
    scope module: [:para, identifier].join('/').to_sym do
      router.instance_eval(&block)
    end
  end
end