Sha256: b976eb694f00fa4f34e9a0e9c6fc60cb4eec1de1d0b084975928c6d65faf131d

Contents?: true

Size: 531 Bytes

Versions: 5

Compression:

Stored size: 531 Bytes

Contents

# frozen_string_literal: true

require "active_support/notifications"
require_relative "feature_event"

module Flipper
  module Notifications
    class FeaturesSubscriber

      def call(*args)
        return unless enabled?

        event = FeatureEvent.from_active_support(event: ActiveSupport::Notifications::Event.new(*args))
        Flipper::Notifications.notify(event: event) if event.noteworthy?
      end

      private

      def enabled?
        Flipper::Notifications.configuration.enabled?
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
flipper-notifications-0.1.5 lib/flipper/notifications/features_subscriber.rb
flipper-notifications-0.1.4 lib/flipper/notifications/features_subscriber.rb
flipper-notifications-0.1.3 lib/flipper/notifications/features_subscriber.rb
flipper-notifications-0.1.2 lib/flipper/notifications/features_subscriber.rb
flipper-notifications-0.1.1 lib/flipper/notifications/features_subscriber.rb