Sha256: e968bd84818cbdfb36cd539f20e7a07a1a929f3a10c24f5bdd06439ca4eb4703

Contents?: true

Size: 630 Bytes

Versions: 12

Compression:

Stored size: 630 Bytes

Contents

require File.expand_path('../example_setup', __FILE__)

require 'flipper'
require 'flipper/adapters/memory'

# sets up default adapter so Flipper works like Flipper::DSL
Flipper.configure do |config|
  config.default do
    Flipper.new Flipper::Adapters::Memory.new
  end
end

puts Flipper.enabled?(:search) # => false
Flipper.enable(:search)
puts Flipper.enabled?(:search) # => true
Flipper.disable(:search)

enabled_actor = Flipper::Actor.new("1")
disabled_actor = Flipper::Actor.new("2")
Flipper.enable_actor(:search, enabled_actor)

puts Flipper.enabled?(:search, enabled_actor)
puts Flipper.enabled?(:search, disabled_actor)

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
flipper-0.15.0 examples/configuring_default.rb
flipper-0.14.0 examples/configuring_default.rb
flipper-0.13.0 examples/configuring_default.rb
flipper-0.13.0.beta1 examples/configuring_default.rb
flipper-0.12.2 examples/configuring_default.rb
flipper-0.12.1 examples/configuring_default.rb
flipper-0.12.0 examples/configuring_default.rb
flipper-0.11.0 examples/configuring_default.rb
flipper-0.11.0.rc1 examples/configuring_default.rb
flipper-0.11.0.beta9 examples/configuring_default.rb
flipper-0.11.0.beta8 examples/configuring_default.rb
flipper-0.11.0.beta7 examples/configuring_default.rb