Class: Vault::PersistentHTTP::Connection
- Inherits:
-
Object
- Object
- Vault::PersistentHTTP::Connection
- Defined in:
- lib/vault/persistent/connection.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#http ⇒ Object
Returns the value of attribute http.
-
#last_use ⇒ Object
Returns the value of attribute last_use.
-
#requests ⇒ Object
Returns the value of attribute requests.
-
#ssl_generation ⇒ Object
Returns the value of attribute ssl_generation.
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(http_class, http_args, ssl_generation) ⇒ Connection
constructor
A new instance of Connection.
- #reset ⇒ Object
- #ressl(ssl_generation) ⇒ Object
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
#http ⇒ Object
Returns the value of attribute http.
11 12 13 |
# File 'lib/vault/persistent/connection.rb', line 11 def http @http end |
#last_use ⇒ Object
Returns the value of attribute last_use.
13 14 15 |
# File 'lib/vault/persistent/connection.rb', line 13 def last_use @last_use end |
#requests ⇒ Object
Returns the value of attribute requests.
15 16 17 |
# File 'lib/vault/persistent/connection.rb', line 15 def requests @requests end |
#ssl_generation ⇒ Object
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
#finish ⇒ Object
26 27 28 29 30 31 |
# File 'lib/vault/persistent/connection.rb', line 26 def finish @http.finish rescue IOError ensure reset end |
#reset ⇒ Object
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 |