5 Matching Annotations
- Apr 2021
-
unix.stackexchange.com unix.stackexchange.com
-
Quite a lot of programs actually detect if their output goes to a file (e.g. try man | grep -F a and you will not be able to scroll back and forth).
-
- Feb 2021
-
github.com github.com
-
It's an implementation of the command pattern in Ruby.
-
-
en.wikipedia.org en.wikipedia.org
-
I think a better, more immediately understandable name for this concept would be command object, because it lets you pass around commands (or a list of commands) as objects.
That's the only thing you really need to know abut this pattern. The rest seems like boring implementation details that aren't that important, and that naturally follow from the primary definition above.
-
Uses
-
The central ideas of this design pattern closely mirror the semantics of first-class functions and higher-order functions in functional programming languages. Specifically, the invoker object is a higher-order function of which the command object is a first-class argument.
-