Sha256: 5d8060a98e17a3b1a411122f5c5ab7f2be01285ddbfa130ea55d9a38db29c4aa

Contents?: true

Size: 505 Bytes

Versions: 2

Compression:

Stored size: 505 Bytes

Contents

module BeforeActions
  module Controller
    class Scope

      def initialize(controller, the_method)
        @controller = controller
        @the_method = the_method
      end

      def all(&block)
        @controller.send(@the_method, &block)
      end

      def only(*list, &block)
        @controller.send(@the_method, {only: list}, &block)
      end

      def except(*list, &block)
        @controller.send(@the_method, {only: list}, &block)
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
before_actions-2.0.1 lib/before_actions/controller/scope.rb
before_actions-2.0.0 lib/before_actions/controller/scope.rb