Module: Trax::Model::UniqueId

Extended by:
Mixin
Defined in:
lib/trax/model/unique_id.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Methods included from Mixin

after_included, extended, mixed, mixed_in

Instance Method Details

#uuidObject



54
55
56
57
58
59
# File 'lib/trax/model/unique_id.rb', line 54

def uuid
  uuid_column = self.class.unique_id_config.uuid_column
  uuid_value = (uuid_column == "uuid") ? super : __send__(uuid_column)

  ::Trax::Model::UUID.new(uuid_value)
end

#uuid_typeObject

i.e. Blog::Post



62
63
64
# File 'lib/trax/model/unique_id.rb', line 62

def uuid_type
  uuid.record_type
end

#uuid_type_nameObject

i.e. ‘Blog::Post’



67
68
69
# File 'lib/trax/model/unique_id.rb', line 67

def uuid_type_name
  uuid.record_type.name
end

#uuid_type_slugObject

i.e, Blog::Post will = post



72
73
74
# File 'lib/trax/model/unique_id.rb', line 72

def uuid_type_slug
  uuid.record_type.name.demodulize.underscore
end