Class: HTTPX::Plugins::Expect::Store

Inherits:
Object
  • Object
show all
Defined in:
lib/httpx/plugins/expect.rb

Instance Method Summary collapse

Constructor Details

#initializeStore



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