Module: DataMapper::Is::ClassMethods
- Defined in:
- lib/dm-is-sluggable/is/class_methods.rb
Instance Method Summary collapse
-
#get(slug) ⇒ Object
_with_slug slug.
- #slug_max_length ⇒ Object
- #slug_permanent? ⇒ Boolean
- #slug_property ⇒ Object
- #slug_property_name ⇒ Object
- #slug_source ⇒ Object
Instance Method Details
#get(slug) ⇒ Object
_with_slug slug
26 27 28 |
# File 'lib/dm-is-sluggable/is/class_methods.rb', line 26 def get slug #_with_slug slug first(slug_property_name => slug) end |
#slug_max_length ⇒ Object
22 23 24 |
# File 'lib/dm-is-sluggable/is/class_methods.rb', line 22 def slug_max_length [:max_length] end |
#slug_permanent? ⇒ Boolean
18 19 20 |
# File 'lib/dm-is-sluggable/is/class_methods.rb', line 18 def slug_permanent? [:permanent?] end |
#slug_property ⇒ Object
5 6 7 8 |
# File 'lib/dm-is-sluggable/is/class_methods.rb', line 5 def slug_property sp = properties[slug_property_name] sp && (sp.type == String ? sp : nil) end |
#slug_property_name ⇒ Object
10 11 12 |
# File 'lib/dm-is-sluggable/is/class_methods.rb', line 10 def slug_property_name [:property_name] end |
#slug_source ⇒ Object
14 15 16 |
# File 'lib/dm-is-sluggable/is/class_methods.rb', line 14 def slug_source [:source] end |