Sha256: 5804c197145026148aaefc160aad0dda186483787562b56d3e7e04889d16dfcb

Contents?: true

Size: 452 Bytes

Versions: 17

Compression:

Stored size: 452 Bytes

Contents

module Flipper
  module UI
    # Internal: Used to detect the action that should be used in the middleware.
    class ActionCollection
      def initialize
        @action_classes = []
      end

      def add(action_class)
        @action_classes << action_class
      end

      def action_for_request(request)
        @action_classes.detect do |action_class|
          request.path_info =~ action_class.regex
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
flipper-ui-0.15.0 lib/flipper/ui/action_collection.rb
flipper-ui-0.14.0 lib/flipper/ui/action_collection.rb
flipper-ui-0.13.0 lib/flipper/ui/action_collection.rb
flipper-ui-0.13.0.beta1 lib/flipper/ui/action_collection.rb
flipper-ui-0.12.2 lib/flipper/ui/action_collection.rb
flipper-ui-0.12.1 lib/flipper/ui/action_collection.rb
flipper-ui-0.12.0 lib/flipper/ui/action_collection.rb
flipper-ui-0.11.0 lib/flipper/ui/action_collection.rb
flipper-ui-0.11.0.rc1 lib/flipper/ui/action_collection.rb
flipper-ui-0.11.0.beta9 lib/flipper/ui/action_collection.rb
flipper-ui-0.11.0.beta8 lib/flipper/ui/action_collection.rb
flipper-ui-0.11.0.beta7 lib/flipper/ui/action_collection.rb
flipper-ui-0.11.0.beta6 lib/flipper/ui/action_collection.rb
flipper-ui-0.11.0.beta5 lib/flipper/ui/action_collection.rb
flipper-ui-0.11.0.beta4 lib/flipper/ui/action_collection.rb
flipper-ui-0.11.0.beta3 lib/flipper/ui/action_collection.rb
flipper-ui-0.11.0.beta1 lib/flipper/ui/action_collection.rb