class Middleman::PreviewServer::NetworkInterfaceInventory::Ipv4

Return all ipv4 interfaces

Public Class Methods

match?(type) click to toggle source
# File lib/middleman-core/preview_server/network_interface_inventory.rb, line 27
def self.match?(type)
  :ipv4 == type
end

Public Instance Methods

network_interfaces() click to toggle source
# File lib/middleman-core/preview_server/network_interface_inventory.rb, line 23
def network_interfaces
  Socket.ip_address_list.select { |ai| ai.ipv4? && !ai.ipv4_loopback? }.map { |ai| ServerIpv4Address.new(ai.ip_address) }
end