Flowdock
method

rotate

Importance_1
v1_9_2_180 - Show latest stable - 0 notes - Class: Array
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.