Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require 'moneta'
require 'flipper'
load './lib/flipper/adapters/moneta.rb'
moneta = Moneta.build do
use :Logger
adapter :Memory
end
adapter = Flipper::Adapters::Moneta.new(moneta)
$flipper = Flipper.new(adapter)
class Actor
attr_reader :flipper_id
def initialize(flipper_id)
@flipper_id = flipper_id
end
end
$actor1 = Actor.new(1)
$actor2 = Actor.new(2)
$actor3 = Actor.new(3)
puts "\n"
puts "############### 3x enable(:feature) #####################"
puts "\n"
$flipper[:feature].enable($actor1)
$flipper[:feature].enable($actor2)
$flipper[:feature].enable($actor3)
puts "\n"
puts "############### feature.inspect #####################"
puts "\n"
$flipper[:feature].inspect
puts "\n"
puts "############### feature.clear #######################"
puts "\n"
$flipper[:feature].clear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment