Flowdock
method

rotate!

Importance_1
v1_9_3_125 - Show latest stable - 0 notes - Class: Array
rotate!(p1 = v1) public

Rotates self in place so that the element at cnt comes first, and returns self. If cnt is negative then it rotates in the opposite direction.

a = [ "a", "b", "c", "d" ]
a.rotate!        #=> ["b", "c", "d", "a"]
a                #=> ["b", "c", "d", "a"]
a.rotate!(2)     #=> ["d", "a", "b", "c"]
a.rotate!(-3)    #=> ["a", "b", "c", "d"]
Show source
Register or log in to add new notes.