Module: WinUtilinfo::MemoryMethods

Included in:
WinUtilinfo
Defined in:
lib/win_utilinfo/memory_methods.rb

Instance Method Summary collapse

Instance Method Details

#get_total_physical_memoryObject



3
4
5
6
7
8
9
# File 'lib/win_utilinfo/memory_methods.rb', line 3

def get_total_physical_memory
	total_physical_memory = `wmic computersystem get totalphysicalmemory | more +1`
	total_physical_memory.strip!
	total_physical_memory = total_physical_memory.to_i / (1024 ** 2)
	total_physical_memory = total_physical_memory.to_s.chars.first(2).join.to_i
	return "#{total_physical_memory}GB"
end