Sha256: 9298840de64182a3867c947c77752db56b1e08a3ba681e23b30585afb9c5fa15

Contents?: true

Size: 316 Bytes

Versions: 2

Compression:

Stored size: 316 Bytes

Contents

module BeforeActions
  class Command
    
    def initialize(controller)
      @controller = controller
    end

    def actions(*actions, &block)
      if actions.empty? || actions.map(&:to_s).include?(@controller.action_name)
        @controller.instance_eval(&block)
      end
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
before_actions-1.0.2 lib/before_actions/command.rb
before_actions-1.0.0 lib/before_actions/command.rb