Class: Lotus::Routing::Resource::Nested Private
- Inherits:
-
Object
- Object
- Lotus::Routing::Resource::Nested
- Defined in:
- lib/lotus/routing/resource/nested.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.
Helper class to calculate nested path
Constant Summary collapse
- SEPARATOR =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'/'.freeze
Instance Method Summary collapse
-
#initialize(resource_name, resource) ⇒ Nested
constructor
private
A new instance of Nested.
- #to_path ⇒ Object private
Constructor Details
#initialize(resource_name, resource) ⇒ Nested
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 Nested.
15 16 17 18 19 20 |
# File 'lib/lotus/routing/resource/nested.rb', line 15 def initialize(resource_name, resource) @resource_name = resource_name.to_s.split(SEPARATOR) @resource = resource @path = [] _calculate(@resource_name.dup, @resource) end |
Instance Method Details
#to_path ⇒ 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.
24 25 26 27 |
# File 'lib/lotus/routing/resource/nested.rb', line 24 def to_path @path.reverse!.pop @resource_name.zip(@path).flatten.join end |