def start!(options = {}, &block)
tty = !!options.delete(:tty)
detached = !!options.delete(:detach)
stdin = options[:stdin]
read_timeout = options[:wait]
body = MultiJson.dump(
'Tty' => tty,
'Detach' => detached
)
excon_params = { body: body }
msgs = Docker::Messages.new
unless detached
if stdin
excon_params[:hijack_block] = Docker::Util.hijack_for(stdin, block,
msgs, tty)
else
excon_params[:response_block] = Docker::Util.attach_for(block,
msgs, tty)
end
end
excon_params[:read_timeout] = read_timeout unless read_timeout.nil?
connection.post(path_for(:start), nil, excon_params)
[msgs.stdout_messages, msgs.stderr_messages, self.json['ExitCode']]
end