Module: ActionDispatch::Routing::Mapper::Base
- Included in:
- ActionDispatch::Routing::Mapper
- Defined in:
- actionpack/lib/action_dispatch/routing/mapper.rb
Instance Method Summary (collapse)
- - (Object) default_url_options=(options) (also: #default_url_options)
-
- (Base) initialize(set)
:nodoc:.
- - (Object) match(path, options = nil)
- - (Object) mount(app, options = nil)
- - (Object) root(options = {})
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 () @set. = end |
- (Base) 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, =nil) mapping = Mapping.new(@set, @scope, path, || {}).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, = nil) if path = .delete(:at) else = app app, path = .find { |k, v| k.respond_to?(:call) } .delete(app) if app end raise "A rack application must be specified" unless path match(path, .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( = {}) match '/', .reverse_merge(:as => :root) end |