Class: Socket::Ifaddr
- Inherits:
-
Data
- Object
- Data
- Socket::Ifaddr
- Defined in:
- lib/socket/ifaddr.rb
Instance Attribute Summary collapse
-
#addr ⇒ Object
readonly
Returns the value of attribute addr.
-
#broadaddr ⇒ Object
readonly
Returns the value of attribute broadaddr.
-
#dstaddr ⇒ Object
readonly
Returns the value of attribute dstaddr.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#ifindex ⇒ Object
readonly
Returns the value of attribute ifindex.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#netmask ⇒ Object
readonly
Returns the value of attribute netmask.
Instance Method Summary collapse
-
#initialize(addr: nil, broadaddr: nil, dstaddr: nil, flags: nil, ifindex: nil, name: nil, netmask: nil) ⇒ Ifaddr
constructor
A new instance of Ifaddr.
- #inspect ⇒ Object
Constructor Details
#initialize(addr: nil, broadaddr: nil, dstaddr: nil, flags: nil, ifindex: nil, name: nil, netmask: nil) ⇒ Ifaddr
Returns a new instance of Ifaddr.
5 6 7 8 9 10 11 12 13 |
# File 'lib/socket/ifaddr.rb', line 5 def initialize(addr: nil, broadaddr: nil, dstaddr: nil, flags: nil, ifindex: nil, name: nil, netmask: nil) @addr = addr @broadaddr = broadaddr @dstaddr = dstaddr @flags = flags @ifindex = ifindex @name = name @netmask = netmask end |
Instance Attribute Details
#addr ⇒ Object (readonly)
Returns the value of attribute addr.
3 4 5 |
# File 'lib/socket/ifaddr.rb', line 3 def addr @addr end |
#broadaddr ⇒ Object (readonly)
Returns the value of attribute broadaddr.
3 4 5 |
# File 'lib/socket/ifaddr.rb', line 3 def broadaddr @broadaddr end |
#dstaddr ⇒ Object (readonly)
Returns the value of attribute dstaddr.
3 4 5 |
# File 'lib/socket/ifaddr.rb', line 3 def dstaddr @dstaddr end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
3 4 5 |
# File 'lib/socket/ifaddr.rb', line 3 def flags @flags end |
#ifindex ⇒ Object (readonly)
Returns the value of attribute ifindex.
3 4 5 |
# File 'lib/socket/ifaddr.rb', line 3 def ifindex @ifindex end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/socket/ifaddr.rb', line 3 def name @name end |
#netmask ⇒ Object (readonly)
Returns the value of attribute netmask.
3 4 5 |
# File 'lib/socket/ifaddr.rb', line 3 def netmask @netmask end |
Instance Method Details
#inspect ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/socket/ifaddr.rb', line 15 def inspect out = "#<Socket::Ifaddr #{name}" if addr out << " #{addr.inspect_sockaddr}" end if netmask out << " netmask=#{netmask.inspect_sockaddr}" end out + '>' end |