Flipper Cloud

Flipper read-only

A read-only adapter for Flipper.

Use this adapter to wrap another adapter and raise an exception for any writes.

Any attempted write raises Flipper::Adapters::ReadOnly::WriteAttempted with message 'write attempted while in read only mode'

Usage

# example wrapping memory adapter
require 'flipper/adapters/read_only'

Flipper.configure do |config|
  config.adapter do
    Flipper::Adapters::ReadOnly.new(Flipper::Adapters::Memory.new)
  end
end

# Enabling a feature
> Flipper[:dashboard_panel].enable
=> Flipper::Adapters::ReadOnly::WriteAttempted: write attempted while in read only mode

On This Page: