Class: Middleman::PreviewServer::NetworkInterfaceInventory
- Inherits:
-
Object
- Object
- Middleman::PreviewServer::NetworkInterfaceInventory
- Defined in:
- lib/middleman-core/preview_server/network_interface_inventory.rb
Overview
This holds information about local network interfaces on the user systemd
Defined Under Namespace
Instance Method Summary collapse
-
#initialize ⇒ NetworkInterfaceInventory
constructor
A new instance of NetworkInterfaceInventory.
-
#network_interfaces(type = :all) ⇒ Object
Return ip interfaces.
Constructor Details
#initialize ⇒ NetworkInterfaceInventory
Returns a new instance of NetworkInterfaceInventory.
49 50 51 52 53 54 |
# File 'lib/middleman-core/preview_server/network_interface_inventory.rb', line 49 def initialize @types = [] @types << Ipv4 @types << Ipv6 @types << All end |
Instance Method Details
#network_interfaces(type = :all) ⇒ Object
Return ip interfaces
60 61 62 |
# File 'lib/middleman-core/preview_server/network_interface_inventory.rb', line 60 def network_interfaces(type=:all) types.find { |t| t.match? type.to_sym }.new.network_interfaces end |