Class: Vault::PersistentHTTP::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/vault/persistent/connection.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_class, http_args, ssl_generation) ⇒ Connection

Returns a new instance of Connection.



19
20
21
22
23
24
# File 'lib/vault/persistent/connection.rb', line 19

def initialize http_class, http_args, ssl_generation
  @http           = http_class.new(*http_args)
  @ssl_generation = ssl_generation

  reset
end

Instance Attribute Details

#httpObject

Returns the value of attribute http.



11
12
13
# File 'lib/vault/persistent/connection.rb', line 11

def http
  @http
end

#last_useObject

Returns the value of attribute last_use.



13
14
15
# File 'lib/vault/persistent/connection.rb', line 13

def last_use
  @last_use
end

#requestsObject

Returns the value of attribute requests.



15
16
17
# File 'lib/vault/persistent/connection.rb', line 15

def requests
  @requests
end

#ssl_generationObject

Returns the value of attribute ssl_generation.



17
18
19
# File 'lib/vault/persistent/connection.rb', line 17

def ssl_generation
  @ssl_generation
end

Instance Method Details

#finishObject



26
27
28
29
30
31
# File 'lib/vault/persistent/connection.rb', line 26

def finish
  @http.finish
rescue IOError
ensure
  reset
end

#resetObject



33
34
35
36
# File 'lib/vault/persistent/connection.rb', line 33

def reset
  @last_use = PersistentHTTP::EPOCH
  @requests = 0
end

#ressl(ssl_generation) ⇒ Object



38
39
40
41
42
# File 'lib/vault/persistent/connection.rb', line 38

def ressl ssl_generation
  @ssl_generation = ssl_generation

  finish
end