Class: Flipper::Adapters::ReadOnly
- Inherits:
-
Object
- Object
- Flipper::Adapters::ReadOnly
- Includes:
- Flipper::Adapter
- Defined in:
- lib/flipper/adapters/read_only.rb
Overview
Public: Adapter that wraps another adapter and raises for any writes.
Defined Under Namespace
Classes: WriteAttempted
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Internal: The name of the adapter.
Instance Method Summary collapse
- #add(feature) ⇒ Object
- #clear(feature) ⇒ Object
- #disable(feature, gate, thing) ⇒ Object
- #enable(feature, gate, thing) ⇒ Object
- #features ⇒ Object
- #get(feature) ⇒ Object
-
#initialize(adapter) ⇒ ReadOnly
constructor
Public.
- #remove(feature) ⇒ Object
Constructor Details
#initialize(adapter) ⇒ ReadOnly
Public
17 18 19 20 |
# File 'lib/flipper/adapters/read_only.rb', line 17 def initialize(adapter) @adapter = adapter @name = :read_only end |
Instance Attribute Details
#name ⇒ Object (readonly)
Internal: The name of the adapter.
14 15 16 |
# File 'lib/flipper/adapters/read_only.rb', line 14 def name @name end |
Instance Method Details
#add(feature) ⇒ Object
30 31 32 |
# File 'lib/flipper/adapters/read_only.rb', line 30 def add(feature) raise WriteAttempted end |
#clear(feature) ⇒ Object
38 39 40 |
# File 'lib/flipper/adapters/read_only.rb', line 38 def clear(feature) raise WriteAttempted end |
#disable(feature, gate, thing) ⇒ Object
46 47 48 |
# File 'lib/flipper/adapters/read_only.rb', line 46 def disable(feature, gate, thing) raise WriteAttempted end |
#enable(feature, gate, thing) ⇒ Object
42 43 44 |
# File 'lib/flipper/adapters/read_only.rb', line 42 def enable(feature, gate, thing) raise WriteAttempted end |
#features ⇒ Object
22 23 24 |
# File 'lib/flipper/adapters/read_only.rb', line 22 def features @adapter.features end |
#get(feature) ⇒ Object
26 27 28 |
# File 'lib/flipper/adapters/read_only.rb', line 26 def get(feature) @adapter.get(feature) end |
#remove(feature) ⇒ Object
34 35 36 |
# File 'lib/flipper/adapters/read_only.rb', line 34 def remove(feature) raise WriteAttempted end |