abstract class TodoOutputPort

Overview

Abstract class representing a Todo output port.

This abstract class defines four abstract methods that must be implemented by its subclasses:

Example Usage:

class ConsoleOutputPort < TodoOutputPort
  def display_todos(todos : Array(Todo))
    todos.each do |todo|
      puts todo.title
    end
  end

  def display_todo_details(todo : Todo)
    puts "Title: #{todo.title}"
    puts "Description: #{todo.description}"
    puts "Due Date: #{todo.due_date}"
  end

  def display_todo_created(todo : Todo)
    puts "Todo created: #{todo.title}"
  end

  def display_todo_completed(todo : Todo)
    puts "Todo completed: #{todo.title}"
  end
end

Inputs:

Flow:

Outputs:

Direct Known Subclasses

Defined in:

domain/ports/todo_output.cr

Instance Method Summary

Instance Method Detail

abstract def display_todo_completed(todo : Todo) : Nil #

[View source]
abstract def display_todo_created(todo : Todo) : Nil #

[View source]
abstract def display_todo_details(todo : Todo) : Nil #

[View source]
abstract def display_todos(todos : Array(Todo)) : Nil #

[View source]