Class: SSHKit::Backend::ConnectionPool::NilCache

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

Overview

A cache that holds no connections. Any connection provided to this cache is simply closed.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#closerObject

Returns the value of attribute closer

Returns:

  • (Object)

    the current value of closer



3
4
5
# File 'lib/sshkit/backends/connection_pool/nil_cache.rb', line 3

def closer
  @closer
end

Instance Method Details

#popObject



4
5
6
# File 'lib/sshkit/backends/connection_pool/nil_cache.rb', line 4

def pop
  nil
end

#push(conn) ⇒ Object



8
9
10
# File 'lib/sshkit/backends/connection_pool/nil_cache.rb', line 8

def push(conn)
  closer.call(conn)
end

#same_key?(_key) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/sshkit/backends/connection_pool/nil_cache.rb', line 12

def same_key?(_key)
  true
end