Class: SystemInspector::Memory

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMemory

Returns a new instance of Memory.



52
53
54
55
# File 'lib/instrumental_tools/system_inspector.rb', line 52

def initialize
  @past_values = {}
  @current_values = {}
end

Instance Attribute Details

#current_valuesObject (readonly)

Returns the value of attribute current_values.



50
51
52
# File 'lib/instrumental_tools/system_inspector.rb', line 50

def current_values
  @current_values
end

#past_valuesObject (readonly)

Returns the value of attribute past_values.



50
51
52
# File 'lib/instrumental_tools/system_inspector.rb', line 50

def past_values
  @past_values
end

Instance Method Details

#cycleObject



65
66
67
68
# File 'lib/instrumental_tools/system_inspector.rb', line 65

def cycle
  @past_values = @current_values
  @current_values = {}
end

#retrieve(attribute) ⇒ Object



61
62
63
# File 'lib/instrumental_tools/system_inspector.rb', line 61

def retrieve(attribute)
  @past_values[attribute]
end

#store(attribute, value) ⇒ Object



57
58
59
# File 'lib/instrumental_tools/system_inspector.rb', line 57

def store(attribute, value)
  @current_values[attribute] = value
end