Module UnixNameModule
In: lib/modules/unix_name_module.rb

Methods

Classes and Modules

Module UnixNameModule::ClassMethods

Public Class methods

[Source]

    # File lib/modules/unix_name_module.rb, line 25
25:   def self.included(base)
26:     base.extend(ClassMethods)
27:     base.send(:initialize_module)
28:   end

Public Instance methods

sets the unix-name of the object, based on it‘s name.

[Source]

    # File lib/modules/unix_name_module.rb, line 34
34:   def set_unix_name
35:     begin
36:       self.unix_name = self.name.downcase.gsub(/[\ .-]/,'_').gsub(/[^a-z_]/,'')
37:     rescue
38:       self.errors.add(:name, "not unique in reduced format")
39:     end
40:   end

[Validate]