some refactoring

This commit is contained in:
Hauke Klement
2015-03-19 14:33:51 +01:00
parent 8787a21c3d
commit ba3476cfec
6 changed files with 121 additions and 62 deletions

View File

@ -4,6 +4,6 @@ module DockerContainerMixin
end
def port_bindings
json['HostConfig']['PortBindings']
json['HostConfig']['PortBindings'].try(:map) { |key, value| [key.to_i, value.first['HostPort'].to_i] }.to_h
end
end