Check arity rather than rely on ruby version for Psych interface change