should be `is_a?(Hash)` if you're adding another condition after it, due to precedence rules:

    irb(main):002:0> nil.is_a? Hash && true
    TypeError: class or module required