class HyperDock::Resource::ContainerPorts
Public Instance Methods
attributes()
click to toggle source
# File lib/hyperdock/resource/container_ports.rb, line 39 def attributes { all: ports, PublicPort: public_port, PrivatePort: private_port, IP: ip, Type: type, tcp: tcp, udp: udp } end
ip()
click to toggle source
# File lib/hyperdock/resource/container_ports.rb, line 19 def ip @ip ||= ports.group_by { |port| port['IP'] } end
links()
click to toggle source
# File lib/hyperdock/resource/container_ports.rb, line 35 def links {} end
ports()
click to toggle source
# File lib/hyperdock/resource/container_ports.rb, line 7 def ports @ports ||= container.info.fetch('Ports') { [] } end
private_port()
click to toggle source
# File lib/hyperdock/resource/container_ports.rb, line 15 def private_port @private_port ||= ports.group_by { |port| port['PrivatePort'] } end
public_port()
click to toggle source
# File lib/hyperdock/resource/container_ports.rb, line 11 def public_port @public_port ||= ports.group_by { |port| port['PublicPort'] } end
tcp()
click to toggle source
# File lib/hyperdock/resource/container_ports.rb, line 27 def tcp @tcp ||= ports.select { |port| port['Type'] == 'tcp' } end
type()
click to toggle source
# File lib/hyperdock/resource/container_ports.rb, line 23 def type @type ||= ports.group_by { |port| port['Type'] } end
udp()
click to toggle source
# File lib/hyperdock/resource/container_ports.rb, line 31 def udp @udp ||= ports.select { |port| port['Type'] == 'udp' } end