Get coordinates of an element by passing its ID in rtuby

I’m trying to get the element’s coordinates by passing the element ID to a function but unfortunately, I’m not able to figure out how should be done.

All I want is, I would like to get the x and y co-ordinates of the element. Please assist how to achieve this.