Class: Sbmt::Strangler::ActionInvoker

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rails_controller:, strangler_action:, metric_tracker:, feature_flags:) ⇒ ActionInvoker

Returns a new instance of ActionInvoker.



8
9
10
11
12
13
# File 'lib/sbmt/strangler/action_invoker.rb', line 8

def initialize(rails_controller:, strangler_action:, metric_tracker:, feature_flags:)
  @rails_controller = rails_controller
  @strangler_action = strangler_action
  @metric_tracker = metric_tracker
  @feature_flags = feature_flags
end

Instance Attribute Details

#feature_flagsObject (readonly)

Returns the value of attribute feature_flags.



6
7
8
# File 'lib/sbmt/strangler/action_invoker.rb', line 6

def feature_flags
  @feature_flags
end

#metric_trackerObject (readonly)

Returns the value of attribute metric_tracker.



6
7
8
# File 'lib/sbmt/strangler/action_invoker.rb', line 6

def metric_tracker
  @metric_tracker
end

#rails_controllerObject (readonly)

Returns the value of attribute rails_controller.



6
7
8
# File 'lib/sbmt/strangler/action_invoker.rb', line 6

def rails_controller
  @rails_controller
end

#strangler_actionObject (readonly)

Returns the value of attribute strangler_action.



6
7
8
# File 'lib/sbmt/strangler/action_invoker.rb', line 6

def strangler_action
  @strangler_action
end

Instance Method Details

#callObject



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/sbmt/strangler/action_invoker.rb', line 17

def call
  track_params_usage
  log_unallowed_params
  track_work_mode(work_mode_class.name.demodulize.underscore)
  work_mode_class.new(
    rails_controller:,
    strangler_action:,
    metric_tracker:,
    feature_flags:
  ).call
end