Class: Flipper::Notifications::Configuration
- Inherits:
-
Object
- Object
- Flipper::Notifications::Configuration
- Defined in:
- lib/flipper/notifications/configuration.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#flipper ⇒ Object
The Flipper instance used to READ feature state when rendering a notification.
-
#notifiers ⇒ Object
Returns the value of attribute notifiers.
-
#webhook_character_limit ⇒ Object
Returns the value of attribute webhook_character_limit.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 10 11 12 |
# File 'lib/flipper/notifications/configuration.rb', line 7 def initialize @enabled = false @notifiers = [] @webhook_character_limit = nil @flipper = nil end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
14 15 16 |
# File 'lib/flipper/notifications/configuration.rb', line 14 def enabled @enabled end |
#flipper ⇒ Object
The Flipper instance used to READ feature state when rendering a
notification. Defaults to the global Flipper.
Notifications are rendered in a background job, which may run in a different process from the one that changed the feature. If your Flipper adapter is fronted by a per-process cache (e.g. an in-memory ActiveSupportCacheStore), the reading process can hold a stale value and the message reports the wrong state. Point this at a cache-free instance backed by your source of truth to always render the real value, e.g.:
config.flipper = Flipper.new(Flipper::Adapters::ActiveRecord.new)
32 33 34 |
# File 'lib/flipper/notifications/configuration.rb', line 32 def flipper @flipper || Flipper end |
#notifiers ⇒ Object
Returns the value of attribute notifiers.
14 15 16 |
# File 'lib/flipper/notifications/configuration.rb', line 14 def notifiers @notifiers end |
#webhook_character_limit ⇒ Object
Returns the value of attribute webhook_character_limit.
14 15 16 |
# File 'lib/flipper/notifications/configuration.rb', line 14 def webhook_character_limit @webhook_character_limit end |
Instance Method Details
#enabled? ⇒ Boolean
17 18 19 |
# File 'lib/flipper/notifications/configuration.rb', line 17 def enabled? @enabled end |