Module: ActionDispatch::Routing::Mapper::Base

Included in:
ActionDispatch::Routing::Mapper
Defined in:
actionpack/lib/action_dispatch/routing/mapper.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) default_url_options=(options) Also known as: default_url_options



254
255
256
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 254

def default_url_options=(options)
  @set.default_url_options = options
end

- (Object) initialize(set)

:nodoc:



225
226
227
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 225

def initialize(set) #:nodoc:
  @set = set
end

- (Object) match(path, options = nil)



233
234
235
236
237
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 233

def match(path, options=nil)
  mapping = Mapping.new(@set, @scope, path, options || {}).to_route
  @set.add_route(*mapping)
  self
end

- (Object) mount(app, options = nil)



239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 239

def mount(app, options = nil)
  if options
    path = options.delete(:at)
  else
    options = app
    app, path = options.find { |k, v| k.respond_to?(:call) }
    options.delete(app) if app
  end

  raise "A rack application must be specified" unless path

  match(path, options.merge(:to => app, :anchor => false, :format => false))
  self
end

- (Object) root(options = {})



229
230
231
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 229

def root(options = {})
  match '/', options.reverse_merge(:as => :root)
end