module Sequel::Plugins::Slugging
Constants
- INTEGER_REGEX
- UUID_REGEX
- VERSION
Attributes
maximum_length[W]
reserved_words[R]
slugifier[W]
Public Class Methods
apply(model, opts = {})
click to toggle source
# File lib/sequel/plugins/slugging.rb, line 34 def apply(model, opts = {}) model.instance_eval do plugin :instance_hooks end end
configure(model, source:, regenerate_slug: nil, history: nil)
click to toggle source
# File lib/sequel/plugins/slugging.rb, line 40 def configure(model, source:, regenerate_slug: nil, history: nil) model.instance_eval do @slugging_opts = {source: source, regenerate_slug: regenerate_slug, history: history}.freeze end end
maximum_length()
click to toggle source
# File lib/sequel/plugins/slugging.rb, line 24 def maximum_length @maximum_length ||= 50 end
reserved_words=(value)
click to toggle source
# File lib/sequel/plugins/slugging.rb, line 30 def reserved_words=(value) @reserved_words = Set.new(value) end
slugifier()
click to toggle source
# File lib/sequel/plugins/slugging.rb, line 18 def slugifier @slugifier ||= proc do |string| string.to_slug.normalize.to_s end end