Class: Breaker::InMemoryRepo::Fuse
- Inherits:
-
Struct
- Object
- Struct
- Breaker::InMemoryRepo::Fuse
- Defined in:
- lib/breaker/in_memory_repo.rb
Instance Attribute Summary collapse
-
#failure_count ⇒ Object
Returns the value of attribute failure_count.
-
#failure_threshold ⇒ Object
Returns the value of attribute failure_threshold.
-
#name ⇒ Object
Returns the value of attribute name.
-
#retry_threshold ⇒ Object
Returns the value of attribute retry_threshold.
-
#retry_timeout ⇒ Object
Returns the value of attribute retry_timeout.
-
#state ⇒ Object
Returns the value of attribute state.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(*args) ⇒ Fuse
constructor
A new instance of Fuse.
Constructor Details
#initialize(*args) ⇒ Fuse
Returns a new instance of Fuse.
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/breaker/in_memory_repo.rb', line 4 def initialize(*args) super self.failure_threshold ||= 10 self.retry_timeout ||= 60 self.timeout ||= 5 self.state ||= :closed self.failure_count ||= 0 end |
Instance Attribute Details
#failure_count ⇒ Object
Returns the value of attribute failure_count
3 4 5 |
# File 'lib/breaker/in_memory_repo.rb', line 3 def failure_count @failure_count end |
#failure_threshold ⇒ Object
Returns the value of attribute failure_threshold
3 4 5 |
# File 'lib/breaker/in_memory_repo.rb', line 3 def failure_threshold @failure_threshold end |
#name ⇒ Object
Returns the value of attribute name
3 4 5 |
# File 'lib/breaker/in_memory_repo.rb', line 3 def name @name end |
#retry_threshold ⇒ Object
Returns the value of attribute retry_threshold
3 4 5 |
# File 'lib/breaker/in_memory_repo.rb', line 3 def retry_threshold @retry_threshold end |
#retry_timeout ⇒ Object
Returns the value of attribute retry_timeout
3 4 5 |
# File 'lib/breaker/in_memory_repo.rb', line 3 def retry_timeout @retry_timeout end |
#state ⇒ Object
Returns the value of attribute state
3 4 5 |
# File 'lib/breaker/in_memory_repo.rb', line 3 def state @state end |
#timeout ⇒ Object
Returns the value of attribute timeout
3 4 5 |
# File 'lib/breaker/in_memory_repo.rb', line 3 def timeout @timeout end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 |
# File 'lib/breaker/in_memory_repo.rb', line 15 def ==(other) other.instance_of?(self.class) && name == other.name end |