module Roda::RodaPlugins::HashRoutes::ClassMethods

  1. lib/roda/plugins/hash_routes.rb

Methods

Public Instance

  1. freeze
  2. hash_routes

Public Instance methods

freeze()

Freeze the hash_routes metadata when freezing the app.

[show source]
    # File lib/roda/plugins/hash_routes.rb
269 def freeze
270   opts[:hash_routes_methods].freeze
271   super
272 end
hash_routes(namespace='', &block)

Invoke the DSL for configuring hash routes, see DSL for methods inside the block. If the block accepts an argument, yield the DSL instance. If the block does not accept an argument, instance_exec the block in the context of the DSL instance.

[show source]
    # File lib/roda/plugins/hash_routes.rb
278 def hash_routes(namespace='', &block)
279   dsl = DSL.new(self, namespace)
280   if block
281     if block.arity == 1
282       yield dsl
283     else
284       dsl.instance_exec(&block)
285     end
286   end
287 
288   dsl
289 end