Skip to content

Instantly share code, notes, and snippets.

@jballanc
Forked from jeffkreeftmeijer/ifs.rb
Last active December 16, 2015 19:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jballanc/5482089 to your computer and use it in GitHub Desktop.
Save jballanc/5482089 to your computer and use it in GitHub Desktop.
def process(input)
commands = {
'q' => -> { puts 'Goodbye' },
'tweet' => -> { puts 'tweeting' },
'dm' => -> { puts 'direct messaging' },
'help' => -> { puts 'helping' }
}
commands.fetch(input, -> {}).call()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment