class UUID4::Formatter::Compact

Constants

FORMAT
REGEXP

Public Instance Methods

decode(value) click to toggle source
# File lib/uuid4/formatter/compact.rb, line 11
def decode(value)
  if value.respond_to?(:to_str) && (value = value.to_str) =~ REGEXP
    value.hex
  end
end
encode(uuid) click to toggle source
# File lib/uuid4/formatter/compact.rb, line 7
def encode(uuid)
  FORMAT % uuid.to_int
end