Class: SystemNetwork
- Inherits:
-
Object
- Object
- SystemNetwork
- Defined in:
- lib/network.rb
Overview
Base and factory for processor probes
Direct Known Subclasses
Constant Summary collapse
- UNLIMITED =
-1
Instance Attribute Summary collapse
-
#default_device ⇒ Object
the default gateway device used.
-
#default_gateway ⇒ Object
the default gateway.
-
#dev_id ⇒ Object
Returns the value of attribute dev_id.
-
#dev_link_speed ⇒ Object
device link speed in Mbps.
-
#dev_type ⇒ Object
Returns the value of attribute dev_type.
-
#download_speed ⇒ Object
download speed in Mbps.
-
#upload_speed ⇒ Object
upload speed in Mbps.
Class Method Summary collapse
Instance Attribute Details
#default_device ⇒ Object
the default gateway device used
12 13 14 |
# File 'lib/network.rb', line 12 def default_device @default_device end |
#default_gateway ⇒ Object
the default gateway
11 12 13 |
# File 'lib/network.rb', line 11 def default_gateway @default_gateway end |
#dev_id ⇒ Object
Returns the value of attribute dev_id.
13 14 15 |
# File 'lib/network.rb', line 13 def dev_id @dev_id end |
#dev_link_speed ⇒ Object
device link speed in Mbps
15 16 17 |
# File 'lib/network.rb', line 15 def dev_link_speed @dev_link_speed end |
#dev_type ⇒ Object
Returns the value of attribute dev_type.
14 15 16 |
# File 'lib/network.rb', line 14 def dev_type @dev_type end |
#download_speed ⇒ Object
download speed in Mbps
10 11 12 |
# File 'lib/network.rb', line 10 def download_speed @download_speed end |
#upload_speed ⇒ Object
upload speed in Mbps
9 10 11 |
# File 'lib/network.rb', line 9 def upload_speed @upload_speed end |
Class Method Details
.probe ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/network.rb', line 17 def self.probe case RbConfig::CONFIG['host_os'] when /linux/ LinuxSystemNetwork.new when /darwin/ MacSystemNetwork.new when /cygwin|mswin|mingw32|mingw|bccwin|wince|emx/ WindowsSystemNetwork.new else RbConfig::CONFIG['host_os'] end end |