Method: ActionDispatch::Routing::RouteSet.new_with_config

Defined in:
actionpack/lib/action_dispatch/routing/route_set.rb

.new_with_config(config) ⇒ Object


347
348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'actionpack/lib/action_dispatch/routing/route_set.rb', line 347

def self.new_with_config(config)
  route_set_config = DEFAULT_CONFIG

  # engines apparently don't have this set
  if config.respond_to? :relative_url_root
    route_set_config.relative_url_root = config.relative_url_root
  end

  if config.respond_to? :api_only
    route_set_config.api_only = config.api_only
  end

  new route_set_config
end