Sha256: a1ca040cd7a17a2342f89688652e4193ffeaf89d30bcab4174296af98757079a

Contents?: true

Size: 375 Bytes

Versions: 16

Compression:

Stored size: 375 Bytes

Contents

module Flipper
  # A default implementation of `#flipper_id` for actors.
  #
  #   class User < Struct.new(:id)
  #     include Flipper::Identifier
  #   end
  #
  #   user = User.new(99)
  #   Flipper.enable :some_feature, user
  #   Flipper.enabled? :some_feature, user #=> true
  #
  module Identifier
    def flipper_id
      "#{self.class.name};#{id}"
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
flipper-1.3.2 lib/flipper/identifier.rb
flipper-1.3.1 lib/flipper/identifier.rb
flipper-1.3.0 lib/flipper/identifier.rb
flipper-1.3.0.pre lib/flipper/identifier.rb
flipper-1.2.2 lib/flipper/identifier.rb
flipper-1.2.1 lib/flipper/identifier.rb
flipper-1.2.0 lib/flipper/identifier.rb
flipper-1.1.2 lib/flipper/identifier.rb
flipper-1.1.1 lib/flipper/identifier.rb
flipper-1.1.0 lib/flipper/identifier.rb
flipper-1.0.0 lib/flipper/identifier.rb
flipper-1.0.0.pre lib/flipper/identifier.rb
flipper-0.28.3 lib/flipper/identifier.rb
flipper-0.28.2 lib/flipper/identifier.rb
flipper-0.28.1 lib/flipper/identifier.rb
flipper-0.28.0 lib/flipper/identifier.rb