Class: Train::Transports::Docker

Inherits:
Object
  • Object
show all
Defined in:
lib/train/transports/docker.rb,
lib/train/transports/docker.rb

Defined Under Namespace

Classes: Connection

Instance Method Summary collapse

Instance Method Details

#connection(state = {}, &block) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/train/transports/docker.rb', line 10

def connection(state = {}, &block)
  opts = merge_options(options, state || {})
  validate_options(opts)

  if @connection && @connection_options == opts
    reuse_connection(&block)
  else
    create_new_connection(opts, &block)
  end
end