Flowdock
method

rotate

Importance_1
rotate(p1 = v1) public

Returns new array by rotating self, whose first element is the element at cnt in self. If cnt is negative then it rotates in counter direction.

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