class Sluggable::Rails::Definition
Attributes
attribute[R]
origin[R]
scope[R]
separator[R]
Public Class Methods
new(attribute = :slug, origin:, separator: '-', scope: nil)
click to toggle source
# File lib/sluggable/rails/definition.rb, line 4 def initialize(attribute = :slug, origin:, separator: '-', scope: nil) self.attribute = attribute self.origin = origin self.separator = separator self.scope = scope end
Public Instance Methods
attribute=(v)
click to toggle source
# File lib/sluggable/rails/definition.rb, line 11 def attribute=(v) @attribute = v.to_s.to_sym end
origin=(v)
click to toggle source
# File lib/sluggable/rails/definition.rb, line 15 def origin=(v) @origin = v.to_s.to_sym end
scope=(v)
click to toggle source
# File lib/sluggable/rails/definition.rb, line 23 def scope=(v) @scope = [v].flatten.map{ |attribute| attribute.present? ? :"#{attribute}" : nil }.compact.uniq end
separator=(v)
click to toggle source
# File lib/sluggable/rails/definition.rb, line 19 def separator=(v) @separator = v.to_s end