-module.exports = class Sluggifiable
+module.exports = class Slugifiable
 
-  generateSlug =(str)->
+  slugify =(str)->
     slug = str
       .toLowerCase()                # change everything to lowercase
       .replace(/^\s+|\s+$/g, "")    # trim leading and trailing spaces

      .replace(/^-+|-+$/g, "")      # trim leading and trailing hyphens

  generateUniqueSlug =(constructor, slug, i, callback)->
    [callback, i] = [i, callback] unless callback
    i ?= 0
    candidate = "#{slug}#{i or ''}"
    constructor.count slug: candidate, (err, count)->
      if err then callback err

  createSlug:(callback)->
    {constructor} = this
    {slugifyFrom} = constructor
    slug = slugify @[slugifyFrom]
    generateUniqueSlug constructor, slug, 0, callback
