Class: Capybara::Server::Middleware::Counter Private
- Inherits:
-
Object
- Object
- Capybara::Server::Middleware::Counter
- Defined in:
- lib/capybara/server/middleware.rb
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.
Instance Attribute Summary collapse
- #value ⇒ Object readonly private
Instance Method Summary collapse
- #decrement ⇒ Object private
- #increment ⇒ Object private
-
#initialize ⇒ Counter
constructor
private
A new instance of Counter.
Constructor Details
#initialize ⇒ Counter
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.
Returns a new instance of Counter.
9 10 11 12 |
# File 'lib/capybara/server/middleware.rb', line 9 def initialize @value = 0 @mutex = Mutex.new end |
Instance Attribute Details
#value ⇒ Object (readonly)
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.
7 8 9 |
# File 'lib/capybara/server/middleware.rb', line 7 def value @value end |
Instance Method Details
#decrement ⇒ 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.
18 19 20 |
# File 'lib/capybara/server/middleware.rb', line 18 def decrement @mutex.synchronize { @value -= 1 } end |
#increment ⇒ 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.
14 15 16 |
# File 'lib/capybara/server/middleware.rb', line 14 def increment @mutex.synchronize { @value += 1 } end |