module WinUtilinfo::MemoryMethods
Public Instance Methods
get_total_physical_memory()
click to toggle source
# 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