Class: SSHKit::Backend::ConnectionPool::Entry
- Inherits:
-
Struct
- Object
- Struct
- SSHKit::Backend::ConnectionPool::Entry
- Defined in:
- lib/sshkit/backends/connection_pool.rb
Instance Attribute Summary collapse
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
Instance Method Summary collapse
Instance Attribute Details
#expires_at ⇒ Object
Returns the value of attribute expires_at.
99 100 101 |
# File 'lib/sshkit/backends/connection_pool.rb', line 99 def expires_at @expires_at end |
Instance Method Details
#close ⇒ Object
109 110 111 |
# File 'lib/sshkit/backends/connection_pool.rb', line 109 def close connection.respond_to?(:close) && connection.close end |
#closed? ⇒ Boolean
113 114 115 |
# File 'lib/sshkit/backends/connection_pool.rb', line 113 def closed? connection.respond_to?(:closed?) && connection.closed? end |
#expired? ⇒ Boolean
105 106 107 |
# File 'lib/sshkit/backends/connection_pool.rb', line 105 def expired? expires_at && Time.now > expires_at end |
#live? ⇒ Boolean
101 102 103 |
# File 'lib/sshkit/backends/connection_pool.rb', line 101 def live? !expired? && !closed? end |