Class: HTTPX::Plugins::Expect::Store
- Inherits:
-
Object
- Object
- HTTPX::Plugins::Expect::Store
- Defined in:
- lib/httpx/plugins/expect.rb
Instance Method Summary collapse
- #add(host) ⇒ Object
- #delete(host) ⇒ Object
- #include?(host) ⇒ Boolean
-
#initialize ⇒ Store
constructor
A new instance of Store.
Constructor Details
#initialize ⇒ Store
15 16 17 18 |
# File 'lib/httpx/plugins/expect.rb', line 15 def initialize @store = [] @mutex = Thread::Mutex.new end |
Instance Method Details
#add(host) ⇒ Object
24 25 26 |
# File 'lib/httpx/plugins/expect.rb', line 24 def add(host) @mutex.synchronize { @store << host } end |
#delete(host) ⇒ Object
28 29 30 |
# File 'lib/httpx/plugins/expect.rb', line 28 def delete(host) @mutex.synchronize { @store.delete(host) } end |
#include?(host) ⇒ Boolean
20 21 22 |
# File 'lib/httpx/plugins/expect.rb', line 20 def include?(host) @mutex.synchronize { @store.include?(host) } end |