Adds support for Ruby 2.2.0

There was a deprecation warning that comparison with invalid objects
will not be supported in the future, so this addresses that issue by
returning nil if an object is not a classy enum.