Sha256: 4b38b736c0922619541d95ba7ad7edca1a48048cbecbec148ff89eb698d8a01d

Contents?: true

Size: 963 Bytes

Versions: 2

Compression:

Stored size: 963 Bytes

Contents

module Vedeu

  module Bindings

    # System events relating to movement of cursors or interfaces.
    #
    # :nocov:
    module Application

      extend self

      # Setup events relating to client applications. This method is
      # called by Vedeu.
      #
      # @return [TrueClass]
      def setup!
        goto!
      end

      private

      # Call a client application controller's action with parameters.
      #
      # @example
      #   Vedeu.trigger(:_goto_,
      #                 :your_controller,
      #                 :some_action,
      #                 { id: 7 })
      #   Vedeu.goto(:your_controller, :some_action, { id: 7 })
      #
      # @return [TrueClass]
      def goto!
        Vedeu.bind(:_goto_) do |controller, action, **args|
          Vedeu::Router.goto(controller, action, **args)
        end

        Vedeu.bind_alias(:_action_, :_goto_)
      end

    end # Application
    # :nocov:

  end # Bindings

end # Vedeu

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.6.8 lib/vedeu/bindings/application.rb
vedeu-0.6.7 lib/vedeu/bindings/application.rb