Sha256: f9a760c77117105123a4a3fcf9739466899442e4bf39f831e465fcfe4fa601aa

Contents?: true

Size: 1.23 KB

Versions: 21

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

module Vedeu

  # Provides methods which should be available to all client
  # application controllers. The client application's
  # ApplicationController will inherit from this class.
  #
  # @api public
  #
  class ApplicationController

    include Vedeu::Controller

    # Returns a new instance of Vedeu::ApplicationController.
    #
    # @param params [Hash] The named parameters provided to the
    #   controller which will be used by the actions within the
    #   controller.
    # @return [Vedeu::ApplicationController]
    def initialize(**params)
      @params = params
    end

    # @param controller [Symbol] The name of controller to be
    #   redirected to.
    # @param action [Symbol] The name of the action within the
    #   controller to be called.
    # @param params [Hash] Any named parameter which need to be passed
    #   to the action.
    def redirect_to(controller, action, **params)
      Vedeu.trigger(:_goto_, controller, action, params)
    end
    alias redirect redirect_to
    alias goto redirect_to

    protected

    # @!attribute [rw] params
    # @return [Hash] The named parameters passed to the controller.
    attr_accessor :params

  end # ApplicationController

end # Vedeu

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
vedeu-0.8.32 lib/vedeu/application/application_controller.rb
vedeu-0.8.31 lib/vedeu/application/application_controller.rb
vedeu-0.8.30 lib/vedeu/application/application_controller.rb
vedeu-0.8.29 lib/vedeu/application/application_controller.rb
vedeu-0.8.28 lib/vedeu/application/application_controller.rb
vedeu-0.8.27 lib/vedeu/application/application_controller.rb
vedeu-0.8.26 lib/vedeu/application/application_controller.rb
vedeu-0.8.25 lib/vedeu/application/application_controller.rb
vedeu-0.8.24 lib/vedeu/application/application_controller.rb
vedeu-0.8.23 lib/vedeu/application/application_controller.rb
vedeu-0.8.22 lib/vedeu/application/application_controller.rb
vedeu-0.8.21 lib/vedeu/application/application_controller.rb
vedeu-0.8.20 lib/vedeu/application/application_controller.rb
vedeu-0.8.19 lib/vedeu/application/application_controller.rb
vedeu-0.8.18 lib/vedeu/application/application_controller.rb
vedeu-0.8.17 lib/vedeu/application/application_controller.rb
vedeu-0.8.16 lib/vedeu/application/application_controller.rb
vedeu-0.8.15 lib/vedeu/application/application_controller.rb
vedeu-0.8.14 lib/vedeu/application/application_controller.rb
vedeu-0.8.13 lib/vedeu/application/application_controller.rb