Module: ModularRoutes::Extension

Defined in:
lib/modular_routes/extension.rb

Instance Method Summary collapse

Instance Method Details

#modular_routes(**options, &block) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/modular_routes/extension.rb', line 5

def modular_routes(**options, &block)
  api_only = options.fetch(:api_only, api_only?)

  route_builder = Builder.new(api_only: api_only)
  route_builder.instance_eval(&block)
  route_builder.routes.each { |route| route.apply(self) }
end