Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (21 sloc) 0.691 kB
require './example_setup'
require 'flipper'
require 'flipper/adapters/memory'
adapter = Flipper::Adapters::Memory.new
flipper = Flipper.new(adapter)
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
end
user1 = User.new(1)
user2 = User.new(2)
puts "Stats for user1: #{stats.enabled?(flipper.actor(user1))}"
puts "Stats for user2: #{stats.enabled?(flipper.actor(user2))}"
puts "\nEnabling stats for user1...\n\n"
stats.enable(flipper.actor(user1))
puts "Stats for user1: #{stats.enabled?(flipper.actor(user1))}"
puts "Stats for user2: #{stats.enabled?(flipper.actor(user2))}"
Jump to Line
Something went wrong with that request. Please try again.