Sha256: ac2d090e878d9c9c49ce4b3c863eed876ae31f2a36cdfc64d154622a090a31b9

Contents?: true

Size: 572 Bytes

Versions: 38

Compression:

Stored size: 572 Bytes

Contents

require 'bundler/setup'
require 'flipper'

stats = Flipper[:stats]

# Some class that represents what will be trying to do something
class User
  attr_reader :id

  def initialize(id)
    @id = id
  end

  # Must respond to flipper_id
  alias_method :flipper_id, :id
end

user1 = User.new(1)
user2 = User.new(2)

puts "Stats for user1: #{stats.enabled?(user1)}"
puts "Stats for user2: #{stats.enabled?(user2)}"

puts "\nEnabling stats for user1...\n\n"
stats.enable(user1)

puts "Stats for user1: #{stats.enabled?(user1)}"
puts "Stats for user2: #{stats.enabled?(user2)}"

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
flipper-1.3.2 examples/individual_actor.rb
flipper-1.3.1 examples/individual_actor.rb
flipper-1.3.0 examples/individual_actor.rb
flipper-1.3.0.pre examples/individual_actor.rb
flipper-1.2.2 examples/individual_actor.rb
flipper-1.2.1 examples/individual_actor.rb
flipper-1.2.0 examples/individual_actor.rb
flipper-1.1.2 examples/individual_actor.rb
flipper-1.1.1 examples/individual_actor.rb
flipper-1.1.0 examples/individual_actor.rb
flipper-1.0.0 examples/individual_actor.rb
flipper-1.0.0.pre examples/individual_actor.rb
flipper-0.28.3 examples/individual_actor.rb
flipper-0.28.2 examples/individual_actor.rb
flipper-0.28.1 examples/individual_actor.rb
flipper-0.28.0 examples/individual_actor.rb
flipper-0.27.1 examples/individual_actor.rb
flipper-0.27.0 examples/individual_actor.rb
flipper-0.26.2 examples/individual_actor.rb
flipper-0.26.1 examples/individual_actor.rb