Sha256: 17c3f40377189aca176830fdb439477fbb88219d0b1bc225237c8d30c5def919
Contents?: true
Size: 841 Bytes
Versions: 16
Compression:
Stored size: 841 Bytes
Contents
module Flipper module Gates class Actor < Gate # Internal: The name of the gate. Used for instrumentation, etc. def name :actor end # Internal: Name converted to value safe for adapter. def key :actors end def data_type :set end def enabled?(value) !value.empty? end # Internal: Checks if the gate is open for an actor. # # Returns true if gate open for actor, false if not. def open?(context) return false unless context.actors? context.actors.any? do |actor| context.values.actors.include?(actor.value) end end def wrap(actor) Types::Actor.wrap(actor) end def protects?(actor) Types::Actor.wrappable?(actor) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems