Sha256: 333b56e8a2a1b5c1e6f14bd19082335b7bf948549a13735e8eba9f3c6173486f

Contents?: true

Size: 644 Bytes

Versions: 12

Compression:

Stored size: 644 Bytes

Contents

rad.controller

class ControllerCaller < Rad::Conveyors::Processor
  def call                
    # prepare
    response = workspace.response.must_be.defined
    klass = workspace.class.must_be.present
    raise "The controller class #{klass} must be a Rad::Controller::Abstract!" unless klass.is? Rad::Controller::Abstract    
    action_name = workspace.action_name = workspace.method_name
    format = workspace.params.format

    # call
    controller = workspace.controller = klass.new
    controller.set! params: workspace.params, action_name: workspace.action_name
    workspace.content = controller.call action_name
  end          

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rad_core-0.2.6 lib/rad/controller/processors/controller_caller.rb
rad_core-0.2.5 lib/rad/controller/processors/controller_caller.rb
rad_core-0.2.4 lib/rad/controller/processors/controller_caller.rb
rad_core-0.2.3 lib/rad/controller/processors/controller_caller.rb
rad_core-0.2.2 lib/rad/controller/processors/controller_caller.rb
rad_core-0.2.1 lib/rad/controller/processors/controller_caller.rb
rad_core-0.2.0 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.30 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.29 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.28 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.27 lib/rad/controller/processors/controller_caller.rb
rad_core-0.0.26 lib/rad/controller/processors/controller_caller.rb