Documentation

Moneta Adapter

A Moneta adapter for Flipper.

Moneta

Installation

Add it to your application's Gemfile with:

$ bundle add flipper-moneta

Or install it yourself with:

$ gem install flipper-moneta

Usage

require 'flipper/adapters/moneta'
moneta = Moneta.new(:Memory)

Flipper.configure do |config|
  config.adapter { Flipper::Adapters::Moneta.new(moneta) }
end

Internals

Each feature is stored as a key namespaced by flipper_features.

require 'flipper/adapters/moneta'
moneta = Moneta.new(:Memory)

Flipper.configure do |config|
  config.adapter { Flipper::Adapters::Moneta.new(moneta) }
end

# Register a few groups.
Flipper.register(:admins) { |thing| thing.admin? }
Flipper.register(:early_access) { |thing| thing.early_access? }

# Create a user class that has flipper_id instance method.
User = Struct.new(:flipper_id)

Flipper[:stats].enable
Flipper[:stats].enable_group :admins
Flipper[:stats].enable_group :early_access
Flipper[:stats].enable_actor User.new('25')
Flipper[:stats].enable_actor User.new('90')
Flipper[:stats].enable_actor User.new('180')
Flipper[:stats].enable_percentage_of_time 15
Flipper[:stats].enable_percentage_of_actors 45

pp moneta["flipper_features/stats"]

{:boolean=>"true",
 :groups=>#<Set: {"admins", "early_access"}>,
 :actors=>#<Set: {"25", "90", "180"}>,
 :percentage_of_actors=>"45",
 :percentage_of_time=>"15"}
Ready to try it out?

Get audit history, rollbacks, advanced permissions, analytics, and all of your projects in one place.


Prefer our Cloudless option?

You can choose from several tiers to sponsor Flipper on GitHub and get some great benefits!

The Friday Deploy

Get updates for all things Flipper—open source and cloud.

Have questions? Need help?

Email us any time or head on over to our documentation or status page for the latest on the app or API.

Ready to take Flipper for a swim?

No credit card required. 14-day free trial. And customer support directly from the developers.