class Memory::Status
Constants
- Format
- Header
Public Class Methods
Source
# File lib/memory_status.rb, line 135 def self.parse(str) status = allocate str.scan(/(?:\A\{|\G,)(#{members.join('|')}):(\d+)(?=,|\}\z)/) do status[$1] = $2.to_i end status end
Public Instance Methods
Source
# File lib/memory_status.rb, line 114 def _update Memory.read_status do |key, val| self[key] = val end self end
Source
# File lib/memory_status.rb, line 128 def to_s status = each_pair.map {|n,v| "#{n}:#{v}" } "{#{status.join(",")}}" end