Sha256: 87d5ea8a218ac37c0a430627bbf04fe2f05447e6eef2e660f51d575329c4f041

Contents?: true

Size: 1.13 KB

Versions: 9

Compression:

Stored size: 1.13 KB

Contents

module Bugsnag::Utility
  # @abstract Requires a #feature_flag_delegate method returning a
  #   {Bugsnag::Utility::FeatureFlagDelegate}
  module FeatureDataStore
    # Add a feature flag with the given name & variant
    #
    # @param name [String]
    # @param variant [String, nil]
    # @return [void]
    def add_feature_flag(name, variant = nil)
      feature_flag_delegate.add(name, variant)
    end

    # Merge the given array of FeatureFlag instances into the stored feature
    # flags
    #
    # New flags will be appended to the array. Flags with the same name will be
    # overwritten, but their position in the array will not change
    #
    # @param feature_flags [Array<Bugsnag::FeatureFlag>]
    # @return [void]
    def add_feature_flags(feature_flags)
      feature_flag_delegate.merge(feature_flags)
    end

    # Remove the stored flag with the given name
    #
    # @param name [String]
    # @return [void]
    def clear_feature_flag(name)
      feature_flag_delegate.remove(name)
    end

    # Remove all the stored flags
    #
    # @return [void]
    def clear_feature_flags
      feature_flag_delegate.clear
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bugsnag-6.27.1 lib/bugsnag/utility/feature_data_store.rb
bugsnag-6.26.4 lib/bugsnag/utility/feature_data_store.rb
bugsnag-6.26.3 lib/bugsnag/utility/feature_data_store.rb
bugsnag-6.26.2 lib/bugsnag/utility/feature_data_store.rb
bugsnag-6.26.1 lib/bugsnag/utility/feature_data_store.rb
bugsnag-6.26.0 lib/bugsnag/utility/feature_data_store.rb
bugsnag-6.25.2 lib/bugsnag/utility/feature_data_store.rb
bugsnag-6.25.1 lib/bugsnag/utility/feature_data_store.rb
bugsnag-6.25.0 lib/bugsnag/utility/feature_data_store.rb