Sha256: 64af1b7b8f7e6d89961a24c7c44284e645e291d38a81e9a53f35709bf557b589

Contents?: true

Size: 449 Bytes

Versions: 22

Compression:

Stored size: 449 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 { |action_class|
          request.path_info =~ action_class.regex
        }
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
flipper-ui-0.10.2 lib/flipper/ui/action_collection.rb
flipper-ui-0.10.1 lib/flipper/ui/action_collection.rb
flipper-ui-0.10.0 lib/flipper/ui/action_collection.rb
flipper-ui-0.9.2 lib/flipper/ui/action_collection.rb
flipper-ui-0.9.1 lib/flipper/ui/action_collection.rb
flipper-ui-0.9.0 lib/flipper/ui/action_collection.rb
flipper-ui-0.9.0.beta1 lib/flipper/ui/action_collection.rb
flipper-ui-0.8.0 lib/flipper/ui/action_collection.rb
flipper-ui-0.7.5 lib/flipper/ui/action_collection.rb
flipper-ui-0.7.4 lib/flipper/ui/action_collection.rb
flipper-ui-0.7.3 lib/flipper/ui/action_collection.rb
flipper-ui-0.7.2 lib/flipper/ui/action_collection.rb
flipper-ui-0.7.1 lib/flipper/ui/action_collection.rb
flipper-ui-0.7.0 lib/flipper/ui/action_collection.rb
flipper-ui-0.7.0.beta6 lib/flipper/ui/action_collection.rb
flipper-ui-0.7.0.beta5 lib/flipper/ui/action_collection.rb
flipper-ui-0.7.0.beta4 lib/flipper/ui/action_collection.rb
flipper-ui-0.2.0.beta5 lib/flipper/ui/action_collection.rb
flipper-ui-0.2.0.beta4 lib/flipper/ui/action_collection.rb
flipper-ui-0.2.0.beta3 lib/flipper/ui/action_collection.rb