Class: Linux::Ip::Addr::IpAddr
- Inherits:
-
Object
- Object
- Linux::Ip::Addr::IpAddr
- Defined in:
- lib/linux/ip/addr.rb
Instance Attribute Summary collapse
-
#interfaces ⇒ Object
readonly
Returns the value of attribute interfaces.
Instance Method Summary collapse
- #find(name) ⇒ Object
-
#initialize ⇒ IpAddr
constructor
A new instance of IpAddr.
- #length ⇒ Object
Constructor Details
#initialize ⇒ IpAddr
Returns a new instance of IpAddr.
22 23 24 |
# File 'lib/linux/ip/addr.rb', line 22 def initialize @interfaces = [] end |
Instance Attribute Details
#interfaces ⇒ Object (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 |
#length ⇒ Object
25 26 27 |
# File 'lib/linux/ip/addr.rb', line 25 def length interfaces.length end |