Skip to content

Instantly share code, notes, and snippets.

@raysrashmi
Created July 9, 2014 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raysrashmi/c700075940e94b7226ce to your computer and use it in GitHub Desktop.
Save raysrashmi/c700075940e94b7226ce to your computer and use it in GitHub Desktop.
require 'json'
a=[1,2,3,4,5,6,7]
h={}
a.each do|i|
if h.keys.empty?
h[i]='rays'
else
h[i]=h.to_json
h.shift
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment