Class: Middleman::PreviewServer::NetworkInterfaceInventory::Ipv6

Inherits:
Object
  • Object
show all
Defined in:
middleman-core/lib/middleman-core/preview_server/network_interface_inventory.rb

Overview

Return all ipv6 interfaces

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.match?(type) ⇒ Boolean


38
39
40
# File 'middleman-core/lib/middleman-core/preview_server/network_interface_inventory.rb', line 38

def self.match?(type)
  type == :ipv6
end

Instance Method Details

#network_interfacesObject


34
35
36
# File 'middleman-core/lib/middleman-core/preview_server/network_interface_inventory.rb', line 34

def network_interfaces
  Socket.ip_address_list.select { |ai| ai.ipv6? && !ai.ipv6_loopback? }.map { |ai| ServerIpv6Address.new(ai.ip_address) }
end