Class: Rethtool::LinkStatus
- Inherits:
-
Object
- Object
- Rethtool::LinkStatus
- Defined in:
- lib/rethtool/link_status.rb
Overview
Instance Method Summary collapse
- #down? ⇒ Boolean
-
#initialize(interface) ⇒ LinkStatus
constructor
A new instance of LinkStatus.
- #up? ⇒ Boolean
Constructor Details
#initialize(interface) ⇒ LinkStatus
Returns a new instance of LinkStatus.
15 16 17 18 19 20 |
# File 'lib/rethtool/link_status.rb', line 15 def initialize(interface) cmd = Rethtool::EthtoolValue.new cmd.cmd = Rethtool::ETHTOOL_CMD_GSET @status = Rethtool.ioctl(interface, cmd).value end |
Instance Method Details
#down? ⇒ Boolean
22 23 24 |
# File 'lib/rethtool/link_status.rb', line 22 def down? @status == 0 end |
#up? ⇒ Boolean
26 27 28 |
# File 'lib/rethtool/link_status.rb', line 26 def up? !down? end |