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.
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 |
#size ⇒ Integer
16 17 18 |
# File 'lib/heapinfo/chunks.rb', line 16 def size @chunks.size end |
#to_s ⇒ String
Hook #to_s for pretty printing.
27 28 29 |
# File 'lib/heapinfo/chunks.rb', line 27 def to_s @chunks.map(&:to_s).join("\n") end |