Skip to content

Instantly share code, notes, and snippets.

@hkparker
Created April 24, 2014 22:25
Show Gist options
  • Save hkparker/11271652 to your computer and use it in GitHub Desktop.
Save hkparker/11271652 to your computer and use it in GitHub Desktop.
Read values from a ruby array by wrapping around the array
class Array
def wrap(n)
tmp = self.shift(n)
self.replace(self+tmp)
return tmp
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment