Class: Majo::Formatter::Color
- Inherits:
-
Object
- Object
- Majo::Formatter::Color
- Includes:
- Colorize
- Defined in:
- lib/majo/formatter/color.rb
Direct Known Subclasses
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(result) ⇒ Color
constructor
A new instance of Color.
Methods included from Colorize
Constructor Details
#initialize(result) ⇒ Color
Returns a new instance of Color.
6 7 8 |
# File 'lib/majo/formatter/color.rb', line 6 def initialize(result) @result = result end |
Instance Method Details
#call ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/majo/formatter/color.rb', line 10 def call allocs = result.allocations retained = result.retained <<~RESULT Total #{total_memory(allocs)} bytes (#{total_objects(allocs)} objects) Total retained #{total_memory(retained)} bytes (#{total_objects(retained)} objects) Memory by file #{} #{format_two_columns(memory_by_file(allocs))} Memory by location #{} #{format_two_columns(memory_by_location(allocs))} Memory by class #{} #{format_two_columns(memory_by_class(allocs))} Objects by file #{} #{format_two_columns(objects_by_file(allocs))} Objects by location #{} #{format_two_columns(objects_by_location(allocs))} Objects by class #{} #{format_two_columns(objects_by_class(allocs))} Retained Memory by file #{} #{format_two_columns(memory_by_file(retained))} Retained Memory by location #{} #{format_two_columns(memory_by_location(retained))} Retained Memory by class #{} #{format_two_columns(memory_by_class(retained))} Retained Objects by file #{} #{format_two_columns(objects_by_file(retained))} Retained Objects by location #{} #{format_two_columns(objects_by_location(retained))} Retained Objects by class #{} #{format_two_columns(objects_by_class(retained))} RESULT end |