Class: StandardCircuit::Config::CircuitSpec
- Inherits:
-
Struct
- Object
- Struct
- StandardCircuit::Config::CircuitSpec
- Defined in:
- lib/standard_circuit/config.rb
Instance Attribute Summary collapse
-
#cool_off_time ⇒ Object
Returns the value of attribute cool_off_time.
-
#criticality ⇒ Object
Returns the value of attribute criticality.
-
#skipped_errors ⇒ Object
Returns the value of attribute skipped_errors.
-
#threshold ⇒ Object
Returns the value of attribute threshold.
-
#tracked_errors ⇒ Object
Returns the value of attribute tracked_errors.
-
#window_size ⇒ Object
Returns the value of attribute window_size.
Class Method Summary collapse
Instance Attribute Details
#cool_off_time ⇒ Object
Returns the value of attribute cool_off_time
9 10 11 |
# File 'lib/standard_circuit/config.rb', line 9 def cool_off_time @cool_off_time end |
#criticality ⇒ Object
Returns the value of attribute criticality
9 10 11 |
# File 'lib/standard_circuit/config.rb', line 9 def criticality @criticality end |
#skipped_errors ⇒ Object
Returns the value of attribute skipped_errors
9 10 11 |
# File 'lib/standard_circuit/config.rb', line 9 def skipped_errors @skipped_errors end |
#threshold ⇒ Object
Returns the value of attribute threshold
9 10 11 |
# File 'lib/standard_circuit/config.rb', line 9 def threshold @threshold end |
#tracked_errors ⇒ Object
Returns the value of attribute tracked_errors
9 10 11 |
# File 'lib/standard_circuit/config.rb', line 9 def tracked_errors @tracked_errors end |
#window_size ⇒ Object
Returns the value of attribute window_size
9 10 11 |
# File 'lib/standard_circuit/config.rb', line 9 def window_size @window_size end |
Class Method Details
.build(**opts) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/standard_circuit/config.rb', line 18 def self.build(**opts) criticality = opts.fetch(:criticality, DEFAULT_CRITICALITY) unless CRITICALITIES.include?(criticality) raise ArgumentError, "invalid criticality #{criticality.inspect}; must be one of #{CRITICALITIES.inspect}" end new( threshold: opts.fetch(:threshold, DEFAULT_THRESHOLD), cool_off_time: opts.fetch(:cool_off_time, DEFAULT_COOL_OFF), window_size: opts.fetch(:window_size, DEFAULT_WINDOW), tracked_errors: opts.fetch(:tracked_errors, NetworkErrors.defaults), skipped_errors: opts.fetch(:skipped_errors, []), criticality: criticality ) end |