Class: Lens::AllocationsData

Inherits:
Object
  • Object
show all
Defined in:
lib/lens/allocations_data.rb,
lib/lens/allocations_data.rb

Instance Method Summary collapse

Constructor Details

#initializeAllocationsData

Returns a new instance of AllocationsData.



6
7
8
9
10
# File 'lib/lens/allocations_data.rb', line 6

def initialize
  @enabled        = false
  @objects_count  = 0
  @objects_memory = 0
end

Instance Method Details

#enableObject



12
13
14
# File 'lib/lens/allocations_data.rb', line 12

def enable
  @enabled = true
end

#objects_countObject



16
17
18
19
# File 'lib/lens/allocations_data.rb', line 16

def objects_count
  @objects_count = calculate_objects_count if @enabled
  @objects_count
end

#objects_memoryObject



21
22
23
24
# File 'lib/lens/allocations_data.rb', line 21

def objects_memory
  @objects_memory = calculate_objects_memory if @enabled
  @objects_memory
end