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