class Para::Plugins::Routes
Attributes
Public Class Methods
Source
# File lib/para/plugins/routes.rb, line 6 def initialize(router) @router = router end
Public Instance Methods
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