treesit.el has this comment:
;; TODO: Document if genuinely useful.
(cons 'n-p-gp
...
I found it useful:
((n-p-gp "}" "hash" "assignment") grand-parent 0)
((n-p-gp "pair" "hash" "assignment") grand-parent ruby-ts-mode-indent-offset)
((n-p-gp "]" "array" "assignment") grand-parent 0)
((n-p-gp ".*" "array" "assignment") grand-parent ruby-ts-mode-indent-offset)
Produces: