Class: TodoFind::DefaultFormatter
- Inherits:
-
Object
- Object
- TodoFind::DefaultFormatter
- Defined in:
- lib/todofind/formatters/default_formatter.rb
Overview
Public: The default output formatter to use when printing the search data.
Instance Method Summary collapse
-
#render(data) ⇒ Object
Public: Render the given data.
Instance Method Details
#render(data) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/todofind/formatters/default_formatter.rb', line 12 def render(data) output = "" data.each do |file| filename = file[:filename] output << "#{filename.green}:\n" file[:comments].each do |comment| output << "#{comment[:line]}: [#{comment[:label].red}] #{comment[:comment]}\n" end output << "\n" end output end |