Files
codeocean/lib/docker_container_mixin.rb
2020-03-23 13:38:50 +01:00

15 lines
299 B
Ruby

module DockerContainerMixin
attr_accessor :start_time
attr_accessor :status
attr_accessor :re_use
def binds
json['HostConfig']['Binds']
end
def port_bindings
json['HostConfig']['PortBindings'].try(:map) { |key, value| [key.to_i, value.first['HostPort'].to_i] }.to_h
end
end