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

Inherits:
Object
  • Object
show all
Defined in:
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

Returns:

  • (Boolean)


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

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

Instance Method Details

#network_interfacesObject



34
35
36
# File '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