Class: HeapInfo::Chunks
- Inherits:
-
Object
- Object
- HeapInfo::Chunks
- Includes:
- Enumerable
- Defined in:
- lib/heapinfo/chunks.rb
Overview
Self-defined array for collecting chunk(s).
Instance Method Summary collapse
- #<<(val) ⇒ void
- #each(&block) ⇒ void
-
#initialize ⇒ Chunks
constructor
Instantiate a Chunks object.
- #size ⇒ Integer
-
#to_s ⇒ String
Hook
#to_sfor pretty printing.
Constructor Details
#initialize ⇒ Chunks
Instantiate a HeapInfo::Chunks object.
8 9 10 |
# File 'lib/heapinfo/chunks.rb', line 8 def initialize @chunks = [] end |
Instance Method Details
#<<(val) ⇒ void
13 14 15 |
# File 'lib/heapinfo/chunks.rb', line 13 def <<(val) @chunks << val end |
#each(&block) ⇒ void
23 24 25 |
# File 'lib/heapinfo/chunks.rb', line 23 def each(&block) @chunks.each(&block) end |
#size ⇒ Integer
18 19 20 |
# File 'lib/heapinfo/chunks.rb', line 18 def size @chunks.size end |
#to_s ⇒ String
Hook #to_s for pretty printing.
29 30 31 |
# File 'lib/heapinfo/chunks.rb', line 29 def to_s @chunks.map(&:to_s).join("\n") end |