class HyperDock::Resource::Network
Public Instance Methods
attributes()
click to toggle source
# File lib/hyperdock/resource/network.rb, line 34 def attributes network.info end
containers()
click to toggle source
# File lib/hyperdock/resource/network.rb, line 20 def containers @containers ||= network .info .fetch('Containers') { {} } .keys .map { |container| { href: "/container/#{container}" } } end
links()
click to toggle source
# File lib/hyperdock/resource/network.rb, line 28 def links @links ||= { containers: containers } end
network()
click to toggle source
# File lib/hyperdock/resource/network.rb, line 8 def network @network ||= ::Docker::Network.get request.path_info[:network] end
resource_exists?()
click to toggle source
# File lib/hyperdock/resource/network.rb, line 13 def resource_exists? !network.nil? rescue ::Docker::Error::NotFoundError false end