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


15
16
17
18
19
20
21
22
23
24
# File 'lib/train/transports/docker.rb', line 15

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