How I can get spatial coordinate of a group?

I don’t know anything about Ruby, but maybe this’ll help…