Class: Solidstats::TodoService
- Inherits:
-
DataCollectorService
- Object
- DataCollectorService
- Solidstats::TodoService
- Defined in:
- app/services/solidstats/todo_service.rb
Overview
Service to collect and process TODO items from codebase
Instance Attribute Summary
Attributes inherited from DataCollectorService
Instance Method Summary collapse
-
#initialize ⇒ TodoService
constructor
Initialize with default cache settings for TODO items.
-
#summary ⇒ Hash
Generate a summary for the dashboard display.
Methods inherited from DataCollectorService
Constructor Details
#initialize ⇒ TodoService
Initialize with default cache settings for TODO items
7 8 9 |
# File 'app/services/solidstats/todo_service.rb', line 7 def initialize super(Rails.root.join("tmp", "solidstats_todos.json")) end |
Instance Method Details
#summary ⇒ Hash
Generate a summary for the dashboard display
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/services/solidstats/todo_service.rb', line 13 def summary todos = fetch return { count: 0, status: "success", message: "No TODO items found" } if todos.nil? || todos.empty? stats = calculate_stats(todos) { count: todos.count, status: determine_status(todos), message: (todos.count), by_type: stats[:by_type], hotspots: stats[:hotspots] } end |