Sha256: a297f9ba4882a9fa404dc744b0917eb3c9e00ed86a33a53edb14ee2cb36ec5ee

Contents?: true

Size: 369 Bytes

Versions: 8

Compression:

Stored size: 369 Bytes

Contents

module Flipper
  module Api
    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

8 entries across 8 versions & 1 rubygems

Version Path
flipper-api-0.10.2 lib/flipper/api/action_collection.rb
flipper-api-0.10.1 lib/flipper/api/action_collection.rb
flipper-api-0.10.0 lib/flipper/api/action_collection.rb
flipper-api-0.9.2 lib/flipper/api/action_collection.rb
flipper-api-0.9.1 lib/flipper/api/action_collection.rb
flipper-api-0.9.0 lib/flipper/api/action_collection.rb
flipper-api-0.9.0.beta1 lib/flipper/api/action_collection.rb
flipper-api-0.8.0 lib/flipper/api/action_collection.rb