Green Glass Door

I've always loved this riddle: what can go through the green glass door?

  • A hammer, but not a nail.
  • A pillow, but not a bed.
  • A deer, but not a wolf.

So here I am, learning Ruby. I just learned how to make web apps using the Sinatra framework. As it turns out, it's pretty simple to determine whether or not something can go through the green class door.


Here's my favorite line of code:
!(/(.)\1/ !~ item.downcase)

Then I heard about these things called APIs.

You mean I can input any word and get back related words? Or make sure it's a noun? Sweet.

Try it!
Code