Class: Rad::Processors::Router
- Inherits:
-
Rad::Processor
- Object
- Rad::Processor
- Rad::Processors::Router
- Defined in:
- lib/rad/router/core/processors/router.rb
Instance Attribute Summary
Attributes inherited from Rad::Processor
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(next_processor, class_variable = :class, method_variable = :method) ⇒ Router
constructor
A new instance of Router.
Methods inherited from Rad::Processor
Constructor Details
#initialize(next_processor, class_variable = :class, method_variable = :method) ⇒ Router
Returns a new instance of Router.
6 7 8 9 |
# File 'lib/rad/router/core/processors/router.rb', line 6 def initialize next_processor, class_variable = :class, method_variable = :method super(next_processor) @class_variable, @method_variable = class_variable, method_variable end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rad/router/core/processors/router.rb', line 11 def call skip = catch :skip do if workspace[@class_variable].blank? or workspace[@method_variable].blank? klass, method, params = router.decode workspace.path, workspace.params workspace[@class_variable], workspace[@method_variable], workspace.params = klass, method, params end nil end if skip logger.info " Skipping '#{workspace.path}'" else next_processor.call end end |