Sha256: fb31f83bca7bff2abb327fb4bc673f533a761d0d8c832c344a1906e09a4f8474

Contents?: true

Size: 500 Bytes

Versions: 54

Compression:

Stored size: 500 Bytes

Contents

module Para
  module Plugins
    class Routes
      attr_reader :router

      def initialize(router)
        @router = router
      end

      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
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
para-0.12.4 lib/para/plugins/routes.rb
para-0.12.3 lib/para/plugins/routes.rb
para-0.12.2 lib/para/plugins/routes.rb
para-0.12.1 lib/para/plugins/routes.rb
para-0.12.0 lib/para/plugins/routes.rb
para-0.11.4 lib/para/plugins/routes.rb
para-0.11.3 lib/para/plugins/routes.rb
para-0.11.2 lib/para/plugins/routes.rb
para-0.11.1 lib/para/plugins/routes.rb
para-0.11.0 lib/para/plugins/routes.rb
para-0.10.0 lib/para/plugins/routes.rb
para-0.9.4 lib/para/plugins/routes.rb
para-0.9.3.3 lib/para/plugins/routes.rb
para-0.9.3.2 lib/para/plugins/routes.rb
para-0.9.3.1 lib/para/plugins/routes.rb
para-0.9.2 lib/para/plugins/routes.rb
para-0.9.0 lib/para/plugins/routes.rb
para-0.8.15 lib/para/plugins/routes.rb
para-0.8.14 lib/para/plugins/routes.rb
para-0.8.13 lib/para/plugins/routes.rb