Class: SystemMemory

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

Overview

Base and factory for memory probes

Constant Summary collapse

UNLIMITED =
-1

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#is_eccObject

boolean true if ECC memory and enabled



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

def is_ecc
  @is_ecc
end

#sizeObject

int in GigaBytes



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

def size
  @size
end

#speedObject

int in MegaHertz



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

def speed
  @speed
end

#swap_sizeObject

size of the swap if any in GigaBytes



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

def swap_size
  @swap_size
end

#typeObject

string DDR type



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

def type
  @type
end

Class Method Details

.probeObject



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/memory.rb', line 15

def self.probe
  case RbConfig::CONFIG['host_os']
  when /linux/
    LinuxSystemMemory.new
  when /darwin/
    MacSystemMemory.new
  when /cygwin|mswin|mingw32|mingw|bccwin|wince|emx/
    WindowsSystemMemory.new
  else
    RbConfig::CONFIG['host_os']
  end
end