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.
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
#http ⇒ Object
Returns the value of attribute http.
8 9 10 |
# File 'lib/vault/persistent/connection.rb', line 8 def http @http end |
#last_use ⇒ Object
Returns the value of attribute last_use.
10 11 12 |
# File 'lib/vault/persistent/connection.rb', line 10 def last_use @last_use end |
#requests ⇒ Object
Returns the value of attribute requests.
12 13 14 |
# File 'lib/vault/persistent/connection.rb', line 12 def requests @requests end |
#ssl_generation ⇒ Object
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
#finish ⇒ Object
23 24 25 26 27 28 |
# File 'lib/vault/persistent/connection.rb', line 23 def finish @http.finish rescue IOError ensure reset end |
#reset ⇒ Object
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 |