0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Helpers to use UUID with uuidtools
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

 Project Readme

UuidHelper

The idea is to provide some helper methods like:

  ''.to_uuid
  nil.to_uuid

Installation

Add this line to your application's Gemfile:

gem 'uuid_helper'

And then execute:

$ bundle

Or install it yourself as:

$ gem install uuid_helper

Usage

Strings

"".to_uuid             
=> #<UUID:0xXXXXXXX UUID:00000000-0000-0000-0000-000000000000>

"\x9ANV\xD2\x990\x11\xE1\xA7h\x00\x13r\x84\xC8\xDF".to_uuid
=> #<UUID:0xXXXXXXX UUID:9a4e56d2-9930-11e1-a768-00137284c8df>
    
"3F3B4A403BF011E181F000137284C8DF".to_uuid
=> #<UUID:0xXXXXXXX UUID:3f3b4a40-3bf0-11e1-81f0-00137284c8df>
 
"3f3b4a40-3bf0-11e1-81f0-00137284c8df".to_uuid
=> #<UUID:0xXXXXXXX UUID:3f3b4a40-3bf0-11e1-81f0-00137284c8df>  

NilClass

nil.to_uuid
=> #<UUID:0xXXXXXXX UUID:00000000-0000-0000-0000-000000000000>

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request