Class: Middleman::PreviewServer::NetworkInterfaceInventory::Ipv4
- Inherits:
-
Object
- Object
- Middleman::PreviewServer::NetworkInterfaceInventory::Ipv4
- Defined in:
- lib/middleman-core/preview_server/network_interface_inventory.rb
Overview
Return all ipv4 interfaces
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.match?(type) ⇒ Boolean
27 28 29 |
# File 'lib/middleman-core/preview_server/network_interface_inventory.rb', line 27 def self.match?(type) :ipv4 == type end |
Instance Method Details
#network_interfaces ⇒ Object
23 24 25 |
# 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 |