field_mask_builder 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/field_mask_builder/engine.rb +4 -5
- data/lib/field_mask_builder/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: 259f7b32872df9edc41bd1cdc8d17e59954538de03e4ddc0df8482e9ed4d1d30
|
4
|
+
data.tar.gz: e589a01db829ccdca0fabb8e8ad48d198ebf738f1b73ed0ba4fb1d7f5b0f205d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23891c3b86f7fe240e011128571dcec35ae7fc86de9f5bb94c59cb1f3d51f37fff5d7a650b13c6e57b076236a3dd157d85144154a1bd68010681a6fdde4543f4
|
7
|
+
data.tar.gz: f10681e787ebe2e03d5c507cc7ff80bf915d68c58bd9ea03a0d68b490878217d4088f67b8f650388143163cc82339df4b01c4d7b3d6bf9d58ac81c768f446062
|
data/Gemfile.lock
CHANGED
@@ -13,7 +13,6 @@ module FieldMaskBuilder
|
|
13
13
|
@fields = fields
|
14
14
|
end
|
15
15
|
|
16
|
-
# @param [<Symbol | { Symbol => Array }>] fields
|
17
16
|
# @return [<String>]
|
18
17
|
def build
|
19
18
|
r = []
|
@@ -22,7 +21,7 @@ module FieldMaskBuilder
|
|
22
21
|
when Symbol, String
|
23
22
|
r.push(f.to_s)
|
24
23
|
when Hash
|
25
|
-
r +=
|
24
|
+
r += to_field_mask_paths(f)
|
26
25
|
else
|
27
26
|
raise "f must be Symbol or String or Hash, but got #{f}"
|
28
27
|
end
|
@@ -32,9 +31,9 @@ module FieldMaskBuilder
|
|
32
31
|
|
33
32
|
private
|
34
33
|
|
35
|
-
# @param [
|
34
|
+
# @param [Hash] hash
|
36
35
|
# @return [<String>]
|
37
|
-
def
|
36
|
+
def to_field_mask_paths(hash)
|
38
37
|
r = []
|
39
38
|
hash.each do |entity, fields|
|
40
39
|
Helper.to_array(fields).each do |f|
|
@@ -42,7 +41,7 @@ module FieldMaskBuilder
|
|
42
41
|
when Symbol, String
|
43
42
|
r.push("#{entity}.#{f}")
|
44
43
|
when Hash
|
45
|
-
r +=
|
44
|
+
r += to_field_mask_paths(f).map { |p| "#{entity}.#{p}" }
|
46
45
|
else
|
47
46
|
raise "f must be Symbol or String or Hash, but got #{f}"
|
48
47
|
end
|