Class: Stoplight::Wiring::ConfigurationDsl

Inherits:
Object
  • Object
show all
Defined in:
lib/stoplight/wiring/configuration_dsl.rb

Instance Method Summary collapse

Constructor Details

#initialize(name: T.undefined, cool_off_time: T.undefined, threshold: T.undefined, recovery_threshold: T.undefined, window_size: T.undefined, tracked_errors: T.undefined, skipped_errors: T.undefined, data_store: T.undefined, error_notifier: T.undefined, notifiers: T.undefined, traffic_control: T.undefined, traffic_recovery: T.undefined) ⇒ ConfigurationDsl

Returns a new instance of ConfigurationDsl.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/stoplight/wiring/configuration_dsl.rb', line 6

def initialize(
  name: T.undefined,
  cool_off_time: T.undefined,
  threshold: T.undefined,
  recovery_threshold: T.undefined,
  window_size: T.undefined,
  tracked_errors: T.undefined,
  skipped_errors: T.undefined,
  data_store: T.undefined,
  error_notifier: T.undefined,
  notifiers: T.undefined,
  traffic_control: T.undefined,
  traffic_recovery: T.undefined
)
  @name = name
  @cool_off_time = cool_off_time
  @threshold = threshold
  @recovery_threshold = recovery_threshold
  @window_size = window_size
  @tracked_errors = tracked_errors
  @skipped_errors = skipped_errors
  @traffic_control = traffic_control
  @traffic_recovery = traffic_recovery
  @error_notifier = error_notifier
  @data_store = data_store
  @notifiers = notifiers
end

Instance Method Details

#configure!(default_config) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/stoplight/wiring/configuration_dsl.rb', line 34

def configure!(default_config)
  ConfigCompatibilityValidator.call(
    config: default_config.with(
      name:,
      cool_off_time:,
      threshold:,
      recovery_threshold:,
      window_size:,
      tracked_errors:,
      skipped_errors:,
      traffic_control:,
      traffic_recovery:,
      error_notifier:,
      data_store:,
      notifiers:
    )
  )
end