Class: Lotus::Routing::Resource::CollectionAction Private
- Defined in:
- lib/lotus/routing/resource/action.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.
Collection action It implements #collection within a #resource block.
Direct Known Subclasses
Constant Summary
Constants inherited from Action
Action::NESTED_ROUTES_SEPARATOR
Instance Method Summary collapse
- #generate(&blk) ⇒ Object private
Methods inherited from Action
generate, #initialize, #namespace, #resource_name
Constructor Details
This class inherits a constructor from Lotus::Routing::Resource::Action
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object (protected)
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.
287 288 289 290 291 292 293 |
# File 'lib/lotus/routing/resource/action.rb', line 287 def method_missing(m, *args) verb = m action_name = Utils::PathPrefix.new(args.first).relative_join(nil) @router.__send__ verb, path(action_name), to: endpoint(action_name), as: as(action_name) end |
Instance Method Details
#generate(&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.
282 283 284 |
# File 'lib/lotus/routing/resource/action.rb', line 282 def generate(&blk) instance_eval(&blk) if block_given? end |