Sha256: 882a5e654e273935b879ee4998133b0234d0231f39552b22c5d563e0ffa1a42a

Contents?: true

Size: 469 Bytes

Versions: 3

Compression:

Stored size: 469 Bytes

Contents

module Flipper
  module Gates
    class Actor < Gate
      Key = :actors

      def type_key
        Key
      end

      def toggle_class
        Toggles::Set
      end

      def open?(actor)
        if actor && actor.respond_to?(:identifier)
          identifiers.include?(actor.identifier)
        end
      end

      def identifiers
        toggle.value
      end

      def protects?(thing)
        thing.is_a?(Flipper::Types::Actor)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flipper-0.2.0 lib/flipper/gates/actor.rb
flipper-0.1.1 lib/flipper/gates/actor.rb
flipper-0.1.0 lib/flipper/gates/actor.rb