Class: UUIDGen::NameSpace
Instance Attribute Summary
Attributes inherited from UUID
Instance Method Summary collapse
-
#initialize(target) ⇒ NameSpace
constructor
A new instance of NameSpace.
- #to_hexa_string ⇒ Object
Methods inherited from UUID
Constructor Details
#initialize(target) ⇒ NameSpace
Returns a new instance of NameSpace.
3 4 5 |
# File 'lib/uuidgen/name_space.rb', line 3 def initialize(target) @decimal = target.gsub('-', '').hex end |
Instance Method Details
#to_hexa_string ⇒ Object
7 8 9 10 11 |
# File 'lib/uuidgen/name_space.rb', line 7 def to_hexa_string to_hex.chars.each_slice(2).map do |first, second| (first + second).hex.chr end.join end |