Class: FeatureFlagger::Notifier
- Inherits:
-
Object
- Object
- FeatureFlagger::Notifier
- Defined in:
- lib/feature_flagger/notifier.rb
Constant Summary collapse
- RELEASE =
'release'.freeze
- UNRELEASE =
'unrelease'.freeze
- RELEASE_TO_ALL =
'release_to_all'.freeze
- UNRELEASE_TO_ALL =
'unrelease_to_all'.freeze
Instance Attribute Summary collapse
-
#notify ⇒ Object
readonly
Returns the value of attribute notify.
Instance Method Summary collapse
-
#initialize(notify = nil) ⇒ Notifier
constructor
A new instance of Notifier.
- #send(operation, feature_key, resource_id = nil) ⇒ Object
Constructor Details
#initialize(notify = nil) ⇒ Notifier
Returns a new instance of Notifier.
10 11 12 |
# File 'lib/feature_flagger/notifier.rb', line 10 def initialize(notify = nil) @notify = valid_notify?(notify) ? notify : nullNotify end |
Instance Attribute Details
#notify ⇒ Object (readonly)
Returns the value of attribute notify.
3 4 5 |
# File 'lib/feature_flagger/notifier.rb', line 3 def notify @notify end |
Instance Method Details
#send(operation, feature_key, resource_id = nil) ⇒ Object
14 15 16 |
# File 'lib/feature_flagger/notifier.rb', line 14 def send(operation, feature_key, resource_id = nil) @notify.call(build_event(operation, extract_resource_from_key(feature_key), feature_key, resource_id)) end |