Class: Lotus::Routing::Namespace Private
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Lotus::Routing::Namespace
- Defined in:
- lib/lotus/routing/namespace.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Namespace for routes. Implementation of Lotus::Router#namespace
Instance Method Summary collapse
- #delete(path, options = {}, &endpoint) ⇒ Object private
- #get(path, options = {}, &endpoint) ⇒ Object private
-
#initialize(router, name, &blk) ⇒ Namespace
constructor
private
A new instance of Namespace.
-
#namespace(name, &blk) ⇒ Object
private
Supports nested namespaces.
- #options(path, options = {}, &endpoint) ⇒ Object private
- #patch(path, options = {}, &endpoint) ⇒ Object private
- #post(path, options = {}, &endpoint) ⇒ Object private
- #put(path, options = {}, &endpoint) ⇒ Object private
- #redirect(path, options = {}, &endpoint) ⇒ Object private
- #resource(name, options = {}) ⇒ Object private
- #resources(name, options = {}) ⇒ Object private
- #trace(path, options = {}, &endpoint) ⇒ Object private
Constructor Details
#initialize(router, name, &blk) ⇒ Namespace
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Namespace.
17 18 19 20 21 22 |
# File 'lib/lotus/routing/namespace.rb', line 17 def initialize(router, name, &blk) @router = router @name = Utils::PathPrefix.new(name) __setobj__(@router) instance_eval(&blk) end |
Instance Method Details
#delete(path, options = {}, &endpoint) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
50 51 52 |
# File 'lib/lotus/routing/namespace.rb', line 50 def delete(path, = {}, &endpoint) super(@name.join(path), , &endpoint) end |
#get(path, options = {}, &endpoint) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/lotus/routing/namespace.rb', line 26 def get(path, = {}, &endpoint) super(@name.join(path), , &endpoint) end |
#namespace(name, &blk) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Supports nested namespaces
87 88 89 |
# File 'lib/lotus/routing/namespace.rb', line 87 def namespace(name, &blk) Routing::Namespace.new(self, name, &blk) end |
#options(path, options = {}, &endpoint) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
62 63 64 |
# File 'lib/lotus/routing/namespace.rb', line 62 def (path, = {}, &endpoint) super(@name.join(path), , &endpoint) end |
#patch(path, options = {}, &endpoint) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
44 45 46 |
# File 'lib/lotus/routing/namespace.rb', line 44 def patch(path, = {}, &endpoint) super(@name.join(path), , &endpoint) end |
#post(path, options = {}, &endpoint) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
32 33 34 |
# File 'lib/lotus/routing/namespace.rb', line 32 def post(path, = {}, &endpoint) super(@name.join(path), , &endpoint) end |
#put(path, options = {}, &endpoint) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 |
# File 'lib/lotus/routing/namespace.rb', line 38 def put(path, = {}, &endpoint) super(@name.join(path), , &endpoint) end |
#redirect(path, options = {}, &endpoint) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
80 81 82 |
# File 'lib/lotus/routing/namespace.rb', line 80 def redirect(path, = {}, &endpoint) super(@name.join(path), .merge(to: @name.join([:to])), &endpoint) end |
#resource(name, options = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
68 69 70 |
# File 'lib/lotus/routing/namespace.rb', line 68 def resource(name, = {}) super name, .merge(namespace: @name.relative_join([:namespace])) end |
#resources(name, options = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
74 75 76 |
# File 'lib/lotus/routing/namespace.rb', line 74 def resources(name, = {}) super name, .merge(namespace: @name.relative_join([:namespace])) end |
#trace(path, options = {}, &endpoint) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
56 57 58 |
# File 'lib/lotus/routing/namespace.rb', line 56 def trace(path, = {}, &endpoint) super(@name.join(path), , &endpoint) end |