Module: ActionDispatch::Routing::Mapper::Base
- Included in:
- ActionDispatch::Routing::Mapper
- Defined in:
- lib/action_dispatch/routing/mapper.rb
Instance Method Summary collapse
- #default_url_options=(options) ⇒ Object (also: #default_url_options)
-
#initialize(set) ⇒ Object
:nodoc:.
- #match(path, options = nil) ⇒ Object
- #mount(app, options = nil) ⇒ Object
- #root(options = {}) ⇒ Object
Instance Method Details
#default_url_options=(options) ⇒ Object Also known as: default_url_options
254 255 256 |
# File 'lib/action_dispatch/routing/mapper.rb', line 254 def () @set. = end |
#initialize(set) ⇒ Object
:nodoc:
225 226 227 |
# File 'lib/action_dispatch/routing/mapper.rb', line 225 def initialize(set) #:nodoc: @set = set end |
#match(path, options = nil) ⇒ Object
233 234 235 236 237 |
# File '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 |
#mount(app, options = nil) ⇒ Object
239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File '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 |
#root(options = {}) ⇒ Object
229 230 231 |
# File 'lib/action_dispatch/routing/mapper.rb', line 229 def root( = {}) match '/', .reverse_merge(:as => :root) end |