Class: SystemNetwork

Inherits:
Object
  • Object
show all
Defined in:
lib/network.rb

Overview

Base and factory for processor probes

Constant Summary collapse

UNLIMITED =
-1

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#default_deviceObject

the default gateway device used



12
13
14
# File 'lib/network.rb', line 12

def default_device
  @default_device
end

#default_gatewayObject

the default gateway



11
12
13
# File 'lib/network.rb', line 11

def default_gateway
  @default_gateway
end

#dev_idObject

Returns the value of attribute dev_id.



13
14
15
# File 'lib/network.rb', line 13

def dev_id
  @dev_id
end

device link speed in Mbps



15
16
17
# File 'lib/network.rb', line 15

def dev_link_speed
  @dev_link_speed
end

#dev_typeObject

Returns the value of attribute dev_type.



14
15
16
# File 'lib/network.rb', line 14

def dev_type
  @dev_type
end

#download_speedObject

download speed in Mbps



10
11
12
# File 'lib/network.rb', line 10

def download_speed
  @download_speed
end

#upload_speedObject

upload speed in Mbps



9
10
11
# File 'lib/network.rb', line 9

def upload_speed
  @upload_speed
end

Class Method Details

.probeObject



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