Method: GnUUID.parse

Defined in:
lib/gn_uuid.rb

.parse(obj) ⇒ Object



20
21
22
23
24
# File 'lib/gn_uuid.rb', line 20

def parse(obj)
  str = obj.to_s.gsub(/\Aurn:uuid:/, "")
  str.gsub!(/[^0-9A-Fa-f]/, "")
  GnUUID::UUID.new([str[0..31]].pack("H*"))
end