Method: JSON::Util::UUID#version

Defined in:
lib/json-schema/util/uuid.rb

#versionObject

Gets the version of this UUID returns nil if bad version



255
256
257
258
259
260
# File 'lib/json-schema/util/uuid.rb', line 255

def version
	a = unpack
	v = (a[2] & 0xF000).to_s(16)[0].chr.to_i
	return v if (1..5).include? v
	return nil
end