Module: Jets::Router::Dsl::Mount
- Included in:
- Jets::Router::Dsl
- Defined in:
- lib/jets/router/dsl/mount.rb
Instance Method Summary collapse
-
#mount(klass, at:) ⇒ Object
The mounted class must be a Rack compatiable class.
Instance Method Details
#mount(klass, at:) ⇒ Object
The mounted class must be a Rack compatiable class
4 5 6 7 8 9 10 11 |
# File 'lib/jets/router/dsl/mount.rb', line 4 def mount(klass, at:) = {to: "jets/mount#call", mount_class: klass} at = at[1..-1] if at.starts_with?('/') # be more forgiving if / accidentally included at_wildcard = at.blank? ? "*path" : "#{at}/*path" any at, any at_wildcard, end |