Class: SystemMemory
- Inherits:
-
Object
- Object
- SystemMemory
- Defined in:
- lib/memory.rb
Overview
Base and factory for memory probes
Direct Known Subclasses
Constant Summary collapse
- UNLIMITED =
-1
Instance Attribute Summary collapse
-
#is_ecc ⇒ Object
boolean true if ECC memory and enabled.
-
#size ⇒ Object
int in GigaBytes.
-
#speed ⇒ Object
int in MegaHertz.
-
#swap_size ⇒ Object
size of the swap if any in GigaBytes.
-
#type ⇒ Object
string DDR type.
Class Method Summary collapse
Instance Attribute Details
#is_ecc ⇒ Object
boolean true if ECC memory and enabled
12 13 14 |
# File 'lib/memory.rb', line 12 def is_ecc @is_ecc end |
#size ⇒ Object
int in GigaBytes
10 11 12 |
# File 'lib/memory.rb', line 10 def size @size end |
#speed ⇒ Object
int in MegaHertz
9 10 11 |
# File 'lib/memory.rb', line 9 def speed @speed end |
#swap_size ⇒ Object
size of the swap if any in GigaBytes
13 14 15 |
# File 'lib/memory.rb', line 13 def swap_size @swap_size end |
#type ⇒ Object
string DDR type
11 12 13 |
# File 'lib/memory.rb', line 11 def type @type end |
Class Method Details
.probe ⇒ Object
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 |