Skip to content

Instantly share code, notes, and snippets.

@jeffandersen
Last active January 28, 2019 14:08
Show Gist options
  • Save jeffandersen/ae32a98e93abd5fcab24a7c0cb1e7327 to your computer and use it in GitHub Desktop.
Save jeffandersen/ae32a98e93abd5fcab24a7c0cb1e7327 to your computer and use it in GitHub Desktop.
Using Prefab.cloud feature flags for cohort release of a new feature
client = Prefab::Client.new(api_key: "ACCT_ID|APIKEY")
@feature_flags = client.feature_flag_client
##
# Where usr is defined as
# usr = {id: 456, attributes: ["beta"]}
if @feature_flags.feature_is_on_for? "templates", "user:" + usr[:id], attributes: usr[:attributes]}
## Execute the templates feature logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment