Object
The default slug generator offers functionality to check slug strings for uniqueness and, if necessary, appends a sequence to guarantee it.
Create a new slug generator.
# File lib/friendly_id/slug_generator.rb, line 8 def initialize(sluggable, normalized) @sluggable = sluggable @normalized = normalized end
Generate a new sequenced slug.
# File lib/friendly_id/slug_generator.rb, line 19 def generate conflict? ? self.next : normalized end
Given a slug, get the next available slug in the sequence.
# File lib/friendly_id/slug_generator.rb, line 14 def next "#{normalized}#{separator}#{next_in_sequence}" end
[Validate]
Generated with the Darkfish Rdoc Generator 2.