A couple stylistic point: 

1. I would wrap the `respond_to?` args in brackets for clarity.
2. use logical `&&` instead of `and` unless you are after control flow. See http://devblog.avdi.org/2010/08/02/using-and-and-or-in-ruby/