Actually, there are two syntaxes for specifying who can do what where:
user MACHINE=(asUSER) COMMANDS
In the first, the commands will always run as root. In the second, the asUSER is a list of users that the user can run the command as (separated by commas) or ALL for all users. This allows you to do things like:
sudo -u anotheruser ls
Now, on to why localhost didn't work. The sudo command looks at the output of hostname and compares that to what is in the sudoers file (ok, it doesn't actually run the hostname command, but the info it gets is the same). You have specified the hostname in the sudoers file as localhost and this isn't the same for sudo. Remember, the reason for being able to specify specific machines it so that you can limit which machines a person can run specific commands on in situations where the same file is being shared between multiple machines. If sudoers allowed localhost in the config, it would really be the same as putting "ALL" since every machine is localhost to itself.
My guess is the error you got was something like:
ryder is not allowed to run sudo on ryder-computer. This incident will be reported.
If you want to be able to run the /bin/ls command as any user on any computer then put
ryder ALL=(ALL) /bin/ls