Class: Stoplight::Domain::Config Private

Inherits:
Data
  • Object
show all
Defined in:
lib/stoplight/domain/config.rb,
lib/stoplight/domain/config.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A Stoplight::Light configuration object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cool_off_timeObject (readonly)

Returns the value of attribute cool_off_time

Returns:

  • (Object)

    the current value of cool_off_time



8
9
10
# File 'lib/stoplight/domain/config.rb', line 8

def cool_off_time
  @cool_off_time
end

#data_storeObject (readonly)

Returns the value of attribute data_store

Returns:

  • (Object)

    the current value of data_store



8
9
10
# File 'lib/stoplight/domain/config.rb', line 8

def data_store
  @data_store
end

#error_notifierObject (readonly)

Returns the value of attribute error_notifier

Returns:

  • (Object)

    the current value of error_notifier



8
9
10
# File 'lib/stoplight/domain/config.rb', line 8

def error_notifier
  @error_notifier
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



8
9
10
# File 'lib/stoplight/domain/config.rb', line 8

def name
  @name
end

#notifiersObject (readonly)

Returns the value of attribute notifiers

Returns:

  • (Object)

    the current value of notifiers



8
9
10
# File 'lib/stoplight/domain/config.rb', line 8

def notifiers
  @notifiers
end

#recovery_thresholdObject (readonly)

Returns the value of attribute recovery_threshold

Returns:

  • (Object)

    the current value of recovery_threshold



8
9
10
# File 'lib/stoplight/domain/config.rb', line 8

def recovery_threshold
  @recovery_threshold
end

#skipped_errorsObject (readonly)

Returns the value of attribute skipped_errors

Returns:

  • (Object)

    the current value of skipped_errors



8
9
10
# File 'lib/stoplight/domain/config.rb', line 8

def skipped_errors
  @skipped_errors
end

#thresholdObject (readonly)

Returns the value of attribute threshold

Returns:

  • (Object)

    the current value of threshold



8
9
10
# File 'lib/stoplight/domain/config.rb', line 8

def threshold
  @threshold
end

#tracked_errorsObject (readonly)

Returns the value of attribute tracked_errors

Returns:

  • (Object)

    the current value of tracked_errors



8
9
10
# File 'lib/stoplight/domain/config.rb', line 8

def tracked_errors
  @tracked_errors
end

#traffic_controlObject (readonly)

Returns the value of attribute traffic_control

Returns:

  • (Object)

    the current value of traffic_control



8
9
10
# File 'lib/stoplight/domain/config.rb', line 8

def traffic_control
  @traffic_control
end

#traffic_recoveryObject (readonly)

Returns the value of attribute traffic_recovery

Returns:

  • (Object)

    the current value of traffic_recovery



8
9
10
# File 'lib/stoplight/domain/config.rb', line 8

def traffic_recovery
  @traffic_recovery
end

#window_sizeObject (readonly)

Returns the value of attribute window_size

Returns:

  • (Object)

    the current value of window_size



8
9
10
# File 'lib/stoplight/domain/config.rb', line 8

def window_size
  @window_size
end

Instance Method Details

#cool_off_time_in_millisecondsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



23
24
25
# File 'lib/stoplight/domain/config.rb', line 23

def cool_off_time_in_milliseconds
  (cool_off_time * 1_000).to_i
end

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/stoplight/domain/config.rb', line 27

def with(
  name: T.undefined,
  cool_off_time: T.undefined,
  threshold: T.undefined,
  recovery_threshold: T.undefined,
  window_size: T.undefined,
  skipped_errors: T.undefined,
  tracked_errors: T.undefined,
  traffic_control: T.undefined,
  traffic_recovery: T.undefined,
  error_notifier: T.undefined,
  notifiers: T.undefined,
  data_store: T.undefined
)
  super(
    name: name.is_a?(Undefined) ? self.name : name,
    cool_off_time: cool_off_time.is_a?(Undefined) ? self.cool_off_time : cool_off_time,
    threshold: threshold.is_a?(Undefined) ? self.threshold : threshold,
    recovery_threshold: recovery_threshold.is_a?(Undefined) ? self.recovery_threshold : recovery_threshold,
    window_size: window_size.is_a?(Undefined) ? self.window_size : window_size,
    skipped_errors: skipped_errors.is_a?(Undefined) ? self.skipped_errors : skipped_errors,
    tracked_errors: tracked_errors.is_a?(Undefined) ? self.tracked_errors : tracked_errors,
    traffic_control: traffic_control.is_a?(Undefined) ? self.traffic_control : traffic_control,
    traffic_recovery: traffic_recovery.is_a?(Undefined) ? self.traffic_recovery : traffic_recovery,
    error_notifier: error_notifier.is_a?(Undefined) ? self.error_notifier : error_notifier,
    notifiers: notifiers.is_a?(Undefined) ? self.notifiers : notifiers,
    data_store: data_store.is_a?(Undefined) ? self.data_store : data_store,
  )
end