Class: ConsoleOutput

Inherits:
Object
  • Object
show all
Defined in:
lib/todo_analyser/console_output.rb

Overview

Print to console

Instance Method Summary collapse

Instance Method Details

#call(todo) ⇒ Object



7
8
9
10
11
12
# File 'lib/todo_analyser/console_output.rb', line 7

def call(todo)
  # Classify TODOs [ ]: Pending, [✓]: Completed
  puts "[#{todo.completed ? '' : ' '}] #{todo.title}  (#{todo.completed ? 'Completed' : 'Pending'})"
  # Alternately can display the status in the end
  # (#{todo.completed ? "Completed" : "Pending"})
end