Class: Sluggable::Rails::Definition

Inherits:
Object
  • Object
show all
Defined in:
lib/sluggable/rails/definition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute = :slug, origin:, separator: '-', scope: nil) ⇒ Definition

Returns a new instance of Definition.



4
5
6
7
8
9
# 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

Instance Attribute Details

#attributeObject

Returns the value of attribute attribute.



2
3
4
# File 'lib/sluggable/rails/definition.rb', line 2

def attribute
  @attribute
end

#originObject

Returns the value of attribute origin.



2
3
4
# File 'lib/sluggable/rails/definition.rb', line 2

def origin
  @origin
end

#scopeObject

Returns the value of attribute scope.



2
3
4
# File 'lib/sluggable/rails/definition.rb', line 2

def scope
  @scope
end

#separatorObject

Returns the value of attribute separator.



2
3
4
# File 'lib/sluggable/rails/definition.rb', line 2

def separator
  @separator
end