Sha256: 1e147cf20eab745da44012ca37a04af61f97006937d83f38209fa254e0ceb030

Contents?: true

Size: 676 Bytes

Versions: 24

Compression:

Stored size: 676 Bytes

Contents

rad.router

class Router < Rad::Conveyors::Processor
  inject router: :router
  
  def initialize next_processor, class_variable = :class, method_variable = :method
    super(next_processor)
    @class_variable, @method_variable = class_variable, method_variable
  end
  
  def call
    halt = catch :halt 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
    
    next_processor.call unless halt
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rad_core-0.2.6 lib/rad/router/processors/router.rb
rad_core-0.2.5 lib/rad/router/processors/router.rb
rad_core-0.2.4 lib/rad/router/processors/router.rb
rad_core-0.2.3 lib/rad/router/processors/router.rb
rad_core-0.2.2 lib/rad/router/processors/router.rb
rad_core-0.2.1 lib/rad/router/processors/router.rb
rad_core-0.2.0 lib/rad/router/processors/router.rb
rad_core-0.0.30 lib/rad/router/processors/router.rb
rad_core-0.0.29 lib/rad/router/processors/router.rb
rad_core-0.0.28 lib/rad/router/processors/router.rb
rad_core-0.0.27 lib/rad/router/processors/router.rb
rad_core-0.0.26 lib/rad/router/processors/router.rb
rad_core-0.0.25 lib/rad/router/processors/router.rb
rad_core-0.0.24 lib/rad/router/processors/router.rb
rad_core-0.0.23 lib/rad/router/processors/router.rb
rad_core-0.0.22 lib/rad/router/processors/router.rb
rad_core-0.0.21 lib/rad/router/processors/router.rb
rad_core-0.0.20 lib/rad/router/processors/router.rb
rad_core-0.0.19 lib/rad/router/processors/router.rb
rad_core-0.0.18 lib/rad/router/processors/router.rb