Module: Bugsnag::Utility::FeatureDataStore Abstract

Included in:
Bugsnag, Report
Defined in:
lib/bugsnag/utility/feature_data_store.rb

Overview

This module is abstract.

Requires a #feature_flag_delegate method returning a FeatureFlagDelegate

Instance Method Summary collapse

Instance Method Details

#add_feature_flag(name, variant = nil) ⇒ void

This method returns an undefined value.

Add a feature flag with the given name & variant

Parameters:

  • name (String)
  • variant (String, nil) (defaults to: nil)


10
11
12
# File 'lib/bugsnag/utility/feature_data_store.rb', line 10

def add_feature_flag(name, variant = nil)
  feature_flag_delegate.add(name, variant)
end

#add_feature_flags(feature_flags) ⇒ void

This method returns an undefined value.

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

Parameters:



22
23
24
# File 'lib/bugsnag/utility/feature_data_store.rb', line 22

def add_feature_flags(feature_flags)
  feature_flag_delegate.merge(feature_flags)
end

#clear_feature_flag(name) ⇒ void

This method returns an undefined value.

Remove the stored flag with the given name

Parameters:

  • name (String)


30
31
32
# File 'lib/bugsnag/utility/feature_data_store.rb', line 30

def clear_feature_flag(name)
  feature_flag_delegate.remove(name)
end

#clear_feature_flagsvoid

This method returns an undefined value.

Remove all the stored flags



37
38
39
# File 'lib/bugsnag/utility/feature_data_store.rb', line 37

def clear_feature_flags
  feature_flag_delegate.clear
end