Class: Sbmt::Strangler::FeatureFlags

Inherits:
Object
  • Object
show all
Defined in:
lib/sbmt/strangler/feature_flags.rb

Constant Summary collapse

FLAGS =
%i[
  mirror
  replace
]
FEATURES_HEADER_NAME =
"HTTP_STRANGLER_FEATURES"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(strangler_action:, rails_controller: nil) ⇒ FeatureFlags

Returns a new instance of FeatureFlags.



14
15
16
17
# File 'lib/sbmt/strangler/feature_flags.rb', line 14

def initialize(strangler_action:, rails_controller: nil)
  @strangler_action = strangler_action
  @rails_controller = rails_controller
end

Instance Attribute Details

#rails_controllerObject (readonly)

Returns the value of attribute rails_controller.



12
13
14
# File 'lib/sbmt/strangler/feature_flags.rb', line 12

def rails_controller
  @rails_controller
end

#strangler_actionObject (readonly)

Returns the value of attribute strangler_action.



12
13
14
# File 'lib/sbmt/strangler/feature_flags.rb', line 12

def strangler_action
  @strangler_action
end

Instance Method Details

#add_all!Object



23
24
25
# File 'lib/sbmt/strangler/feature_flags.rb', line 23

def add_all!
  FLAGS.each { |flag_name| add(feature_name(flag_name)) }
end