Class: Majo::Formatter::Color

Inherits:
Object
  • Object
show all
Includes:
Colorize
Defined in:
lib/majo/formatter/color.rb

Direct Known Subclasses

Monochrome

Instance Method Summary collapse

Methods included from Colorize

#blue, #cyan

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

#callObject



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
# File 'lib/majo/formatter/color.rb', line 10

def call
  "    Total \#{total_memory} bytes (\#{total_objects} objects)\n\n    Memory by file\n    \#{bar}\n    \#{format_two_columns(memory_by_file)}\n\n    Memory by location\n    \#{bar}\n    \#{format_two_columns(memory_by_location)}\n\n    Memory by class\n    \#{bar}\n    \#{format_two_columns(memory_by_class)}\n\n    Objects by file\n    \#{bar}\n    \#{format_two_columns(objects_by_file)}\n\n    Objects by location\n    \#{bar}\n    \#{format_two_columns(objects_by_location)}\n\n    Objects by class\n    \#{bar}\n    \#{format_two_columns(objects_by_class)}\n  RESULT\nend\n"