Class: SSHKit::Backend::ConnectionPool::Entry

Inherits:
Struct
  • Object
show all
Defined in:
lib/sshkit/backends/connection_pool.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#expires_atObject

Returns the value of attribute expires_at.



54
55
56
# File 'lib/sshkit/backends/connection_pool.rb', line 54

def expires_at
  @expires_at
end

Instance Method Details

#closed?Boolean

Returns:

  • (Boolean)


64
65
66
# File 'lib/sshkit/backends/connection_pool.rb', line 64

def closed?
  connection.respond_to?(:closed?) && connection.closed?
end

#expired?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/sshkit/backends/connection_pool.rb', line 60

def expired?
  expires_at && Time.now > expires_at
end

#live?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/sshkit/backends/connection_pool.rb', line 56

def live?
  !expired? && !closed?
end