the_string_to_slug 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/the_string_to_slug.rb +10 -1
- data/lib/the_string_to_slug/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 389c73d98e47c79490aae2d4b9ee61f28109e04f
|
4
|
+
data.tar.gz: ba6928be8712df7e7c01b8f514897fc772f1ca4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3485d14abf498e308747a5aa43e43928faf1402b2321616cb3a9f11bf388593a11c97c334faa43d0bd22675908e30a998c62cc0b9c8a9615ffaccb5d330e97eb
|
7
|
+
data.tar.gz: ec782be0a9e01a778cfe9ad26c3bd4972678cb844f0d79180c14d7d4b2e0f630d658039d651413c7fd56e57186ea93dd174b8d989acb88ced5547a5f4ebd2acf
|
data/lib/the_string_to_slug.rb
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
require "the_string_to_slug/version"
|
2
|
-
require "the_string_to_slug/string"
|
3
2
|
|
4
3
|
module TheStringToSlug; end
|
4
|
+
|
5
|
+
class String
|
6
|
+
def self.to_slug_param str
|
7
|
+
I18n::transliterate(str).gsub('_','-').parameterize('-').downcase
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_slug_param
|
11
|
+
self.class.to_slug_param(self)
|
12
|
+
end
|
13
|
+
end
|