Module: BasedUUID::ModelExtensions

Extended by:
ActiveSupport::Concern
Defined in:
lib/based_uuid/has_based_uuid.rb

Instance Method Summary collapse

Instance Method Details

#based_uuid(prefix: true) ⇒ Object



50
51
52
53
54
# File 'lib/based_uuid/has_based_uuid.rb', line 50

def based_uuid(prefix: true)
  return nil if _uuid_column_value.blank?

  BasedUUID.encode(uuid: _uuid_column_value, prefix: prefix ? self.class._based_uuid_prefix : nil)
end

#based_uuid_with_prefixObject



56
57
58
# File 'lib/based_uuid/has_based_uuid.rb', line 56

def based_uuid_with_prefix
  based_uuid(prefix: true)
end

#based_uuid_without_prefixObject



60
61
62
# File 'lib/based_uuid/has_based_uuid.rb', line 60

def based_uuid_without_prefix
  based_uuid(prefix: false)
end