How to change starting Edge of a face?

Hello People I got this face with it’s own 10 edges.

I need to make a Ruby Extension to change the Starting Edge of a Face like this.

image