Class: Protoboard::Circuit
- Inherits:
-
Object
- Object
- Protoboard::Circuit
- Defined in:
- lib/protoboard/circuit.rb
Overview
This class represents a circuit.
Instance Attribute Summary collapse
-
#cool_off_after ⇒ Object
readonly
Returns the value of attribute cool_off_after.
-
#fallback ⇒ Object
readonly
Returns the value of attribute fallback.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#on_after ⇒ Object
readonly
Returns the value of attribute on_after.
-
#on_before ⇒ Object
readonly
Returns the value of attribute on_before.
-
#open_after ⇒ Object
readonly
Returns the value of attribute open_after.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
-
#initialize(**options) ⇒ Circuit
constructor
A new instance of Circuit.
- #singleton_method? ⇒ Boolean
Constructor Details
#initialize(**options) ⇒ Circuit
Returns a new instance of Circuit.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/protoboard/circuit.rb', line 12 def initialize(**) @name = .fetch(:name) @service = .fetch(:service) @method_name = .fetch(:method_name) @open_after = .fetch(:open_after) @cool_off_after = .fetch(:cool_off_after) @fallback = [:fallback] @on_before = .fetch(:on_before, []) @on_after = .fetch(:on_after, []) @singleton_method = .fetch(:singleton_method, false) rescue KeyError => error raise ArgumentError, "Missing required arguments: #{error.}" end |
Instance Attribute Details
#cool_off_after ⇒ Object (readonly)
Returns the value of attribute cool_off_after.
7 8 9 |
# File 'lib/protoboard/circuit.rb', line 7 def cool_off_after @cool_off_after end |
#fallback ⇒ Object (readonly)
Returns the value of attribute fallback.
7 8 9 |
# File 'lib/protoboard/circuit.rb', line 7 def fallback @fallback end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
7 8 9 |
# File 'lib/protoboard/circuit.rb', line 7 def method_name @method_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/protoboard/circuit.rb', line 7 def name @name end |
#on_after ⇒ Object (readonly)
Returns the value of attribute on_after.
7 8 9 |
# File 'lib/protoboard/circuit.rb', line 7 def on_after @on_after end |
#on_before ⇒ Object (readonly)
Returns the value of attribute on_before.
7 8 9 |
# File 'lib/protoboard/circuit.rb', line 7 def on_before @on_before end |
#open_after ⇒ Object (readonly)
Returns the value of attribute open_after.
7 8 9 |
# File 'lib/protoboard/circuit.rb', line 7 def open_after @open_after end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
7 8 9 |
# File 'lib/protoboard/circuit.rb', line 7 def service @service end |
Instance Method Details
#singleton_method? ⇒ Boolean
26 27 28 |
# File 'lib/protoboard/circuit.rb', line 26 def singleton_method? @singleton_method end |