GUID/UUID in Ruby

Surprisingly Ruby doesn’t come with a built in GUID generator. Thankfully there is the useful uuid project which implements a gem that you can easily install and use to generate GUIDs.

1. gem install uuid

2. require 'uuid'

3. UUID.new

Gems rock.

 

Trackbacks

(Trackback URL)

close Reblog this comment
blog comments powered by Disqus