keycase 1.2.0 → 1.3.0

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.
@@ -1,60 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "set"
4
-
5
- require_relative "support/transformer"
6
- require_relative "support/tokenizer"
7
-
8
- module Keycase
9
- module PascalCase
10
- refine Object do
11
- def to_pascal_case
12
- self
13
- end
14
-
15
- def with_pascal_case_keys(_options = {})
16
- self
17
- end
18
- end
19
-
20
- refine String do
21
- def to_pascal_case
22
- Keycase::Support::Tokenizer.words(self).map do |word|
23
- word.capitalize
24
- end.join
25
- end
26
- end
27
-
28
- refine Symbol do
29
- def to_pascal_case
30
- to_s.to_pascal_case.to_sym
31
- end
32
- end
33
-
34
- refine Array do
35
- def with_pascal_case_keys(options = {})
36
- Keycase::Support::Transformer.transform_array(
37
- self,
38
- ::Set.new,
39
- 0,
40
- options[:max_depth]
41
- ) do |key|
42
- key.to_pascal_case
43
- end
44
- end
45
- end
46
-
47
- refine Hash do
48
- def with_pascal_case_keys(options = {})
49
- Keycase::Support::Transformer.transform_hash(
50
- self,
51
- ::Set.new,
52
- 0,
53
- options[:max_depth]
54
- ) do |key|
55
- key.to_pascal_case
56
- end
57
- end
58
- end
59
- end
60
- end
@@ -1,60 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "set"
4
-
5
- require_relative "support/transformer"
6
- require_relative "support/tokenizer"
7
-
8
- module Keycase
9
- module ScreamingSnakeCase
10
- refine Object do
11
- def to_screaming_snake_case
12
- self
13
- end
14
-
15
- def with_screaming_snake_case_keys(_options = {})
16
- self
17
- end
18
- end
19
-
20
- refine String do
21
- def to_screaming_snake_case
22
- Keycase::Support::Tokenizer.words(self).map do |word|
23
- word.upcase
24
- end.join("_")
25
- end
26
- end
27
-
28
- refine Symbol do
29
- def to_screaming_snake_case
30
- to_s.to_screaming_snake_case.to_sym
31
- end
32
- end
33
-
34
- refine Array do
35
- def with_screaming_snake_case_keys(options = {})
36
- Keycase::Support::Transformer.transform_array(
37
- self,
38
- ::Set.new,
39
- 0,
40
- options[:max_depth]
41
- ) do |key|
42
- key.to_screaming_snake_case
43
- end
44
- end
45
- end
46
-
47
- refine Hash do
48
- def with_screaming_snake_case_keys(options = {})
49
- Keycase::Support::Transformer.transform_hash(
50
- self,
51
- ::Set.new,
52
- 0,
53
- options[:max_depth]
54
- ) do |key|
55
- key.to_screaming_snake_case
56
- end
57
- end
58
- end
59
- end
60
- end
@@ -1,60 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "set"
4
-
5
- require_relative "support/transformer"
6
- require_relative "support/tokenizer"
7
-
8
- module Keycase
9
- module TrainCase
10
- refine Object do
11
- def to_train_case
12
- self
13
- end
14
-
15
- def with_train_case_keys(_options = {})
16
- self
17
- end
18
- end
19
-
20
- refine String do
21
- def to_train_case
22
- Keycase::Support::Tokenizer.words(self).map do |word|
23
- word.capitalize
24
- end.join("-")
25
- end
26
- end
27
-
28
- refine Symbol do
29
- def to_train_case
30
- to_s.to_train_case.to_sym
31
- end
32
- end
33
-
34
- refine Array do
35
- def with_train_case_keys(options = {})
36
- Keycase::Support::Transformer.transform_array(
37
- self,
38
- ::Set.new,
39
- 0,
40
- options[:max_depth]
41
- ) do |key|
42
- key.to_train_case
43
- end
44
- end
45
- end
46
-
47
- refine Hash do
48
- def with_train_case_keys(options = {})
49
- Keycase::Support::Transformer.transform_hash(
50
- self,
51
- ::Set.new,
52
- 0,
53
- options[:max_depth]
54
- ) do |key|
55
- key.to_train_case
56
- end
57
- end
58
- end
59
- end
60
- end