Class: Linux::Ip::Addr::IpAddr

Inherits:
Object
  • Object
show all
Defined in:
lib/linux/ip/addr.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeIpAddr

Returns a new instance of IpAddr.



22
23
24
# File 'lib/linux/ip/addr.rb', line 22

def initialize
  @interfaces = []
end

Instance Attribute Details

#interfacesObject (readonly)

Returns the value of attribute interfaces.



21
22
23
# File 'lib/linux/ip/addr.rb', line 21

def interfaces
  @interfaces
end

Instance Method Details

#find(name) ⇒ Object



28
29
30
# File 'lib/linux/ip/addr.rb', line 28

def find(name)
  interfaces.find { |i| i.name == name }
end

#lengthObject



25
26
27
# File 'lib/linux/ip/addr.rb', line 25

def length
  interfaces.length
end