MΓ³dulo 23 Β· Design Patterns (All 23 GoF) β LecciΓ³n 14 de 23 Β· ~6 min
Command
Command: package a request as an object
Problem: you want to store, queue, log, or undo an action β which means the action must be a thing, not just a method call.
PawWalk scenario: background jobs. Each job IS a command: an object responding to call. A runner executes a list of them in order.
In Ruby, 'responds to call' is the whole contract β an object with a call method, a lambda, or a Proc all qualify.