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.



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

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.



8
9
10
# File 'lib/vault/persistent/connection.rb', line 8

def http
  @http
end

#last_useObject

Returns the value of attribute last_use.



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

def last_use
  @last_use
end

#requestsObject

Returns the value of attribute requests.



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

def requests
  @requests
end

#ssl_generationObject

Returns the value of attribute ssl_generation.



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

def ssl_generation
  @ssl_generation
end

Instance Method Details

#finishObject



23
24
25
26
27
28
# File 'lib/vault/persistent/connection.rb', line 23

def finish
  @http.finish
rescue IOError
ensure
  reset
end

#resetObject



30
31
32
33
# File 'lib/vault/persistent/connection.rb', line 30

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

#ressl(ssl_generation) ⇒ Object



35
36
37
38
39
# File 'lib/vault/persistent/connection.rb', line 35

def ressl ssl_generation
  @ssl_generation = ssl_generation

  finish
end