In working on her command line todo manager, Katie asked a good question about being able to use a NoMethodError
. NoMethodError
specifically applies to trying to call methods on an object and there isn't (an obvious) one here, but I wanted to suggest an idea. Notice that you probably have a big long where
statement where each case
is just "do the thing that the user typed in with whatever arguments they supplied". Here's one potential way to simplify that:
class Dispatcher
def add
...
end
def list
...
end