lucky_case 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/lucky_case/string.rb +10 -0
- data/lib/lucky_case/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a02e8e5b6c87d69698ea74ce773d0db80054d0f95df611cf6787c8b64ca2ef9a
|
4
|
+
data.tar.gz: 65618b4882eafd8ef600cd798e9bad39a50b0bf3094ff140c6c6e17542fbe038
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 929b76eb4c553e6e1e404d33f2b60d6e8506f376fe3524ace0178e93d2b93da786e779d9b6b24d57faa4ad631edb43ae95319a9a74691d6779b5027dbba6db3f
|
7
|
+
data.tar.gz: 69120e28465009a311bdce99ffc49b071250f02cf5be846ef0a6256a7464e14f74b4a01609adcd4782e8bdf13980e3d71a4d4c8d64f91eea0138881644475881
|
data/README.md
CHANGED
@@ -55,7 +55,7 @@ LuckyCase.capitalize('example') # => 'Example'
|
|
55
55
|
LuckyCase.constantize('some_constant') # => SomeConstant
|
56
56
|
LuckyCase.constantize('SOME_CONSTANT') # => SomeConstant
|
57
57
|
LuckyCase.constantize('some/path_example/folder') # => Some::PathExample::Folder
|
58
|
-
LuckyCase.deconstantize(SomeConstant) # => 'some_constant'
|
58
|
+
LuckyCase.deconstantize(SomeConstant) # => 'some_constant' // default case_type: :snake_case
|
59
59
|
LuckyCase.deconstantize(Some::PathExample::Folder, case_type: :camel_case) # => 'some/pathExample/folder'
|
60
60
|
|
61
61
|
# identifiers
|
data/lib/lucky_case/string.rb
CHANGED
@@ -21,6 +21,11 @@ class String
|
|
21
21
|
#
|
22
22
|
# @param [Boolean] allow_prefixed_underscores
|
23
23
|
# @return [Symbol,nil] symbol of type, nil if no match
|
24
|
+
def letter_case(allow_prefixed_underscores: true)
|
25
|
+
LuckyCase.case self, allow_prefixed_underscores: allow_prefixed_underscores
|
26
|
+
end
|
27
|
+
|
28
|
+
# easter egg version of #letter_case
|
24
29
|
def lucky_case(allow_prefixed_underscores: true)
|
25
30
|
LuckyCase.case self, allow_prefixed_underscores: allow_prefixed_underscores
|
26
31
|
end
|
@@ -29,6 +34,11 @@ class String
|
|
29
34
|
#
|
30
35
|
# @param [Boolean] allow_prefixed_underscores
|
31
36
|
# @return [Array<Symbol>,nil] symbols of types, nil if no one matches
|
37
|
+
def letter_cases(allow_prefixed_underscores: true)
|
38
|
+
LuckyCase.cases self, allow_prefixed_underscores: allow_prefixed_underscores
|
39
|
+
end
|
40
|
+
|
41
|
+
# easter egg version of #letter_cases
|
32
42
|
def lucky_cases(allow_prefixed_underscores: true)
|
33
43
|
LuckyCase.cases self, allow_prefixed_underscores: allow_prefixed_underscores
|
34
44
|
end
|
data/lib/lucky_case/version.rb
CHANGED