Class: HeapInfo::Chunks

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/heapinfo/chunks.rb

Overview

Self-defined array for collecting chunk(s).

Instance Method Summary collapse

Constructor Details

#initializeChunks

Instantiate a HeapInfo::Chunks object.


6
7
8
# File 'lib/heapinfo/chunks.rb', line 6

def initialize
  @chunks = []
end

Instance Method Details

#<<(val) ⇒ void

This method returns an undefined value.


11
12
13
# File 'lib/heapinfo/chunks.rb', line 11

def <<(val)
  @chunks << val
end

#each(&block) ⇒ void

This method returns an undefined value.


21
22
23
# File 'lib/heapinfo/chunks.rb', line 21

def each(&block)
  @chunks.each(&block)
end

#sizeInteger

Returns:

  • (Integer)

16
17
18
# File 'lib/heapinfo/chunks.rb', line 16

def size
  @chunks.size
end

#to_sString

Hook #to_s for pretty printing.

Returns:

  • (String)

27
28
29
# File 'lib/heapinfo/chunks.rb', line 27

def to_s
  @chunks.map(&:to_s).join("\n")
end