field_mask_parser 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38f5a42c2c54bca7181d9d4ca27e9169b20c4aa360f15630de3892fb178e8af0
4
- data.tar.gz: 05cb2a3625d5bf88bbd0dd4302c116c224b535fc5df1ec122300e1ea280e41d3
3
+ metadata.gz: 8169f8b0b07995644bde6891e92755889af7881e5bb742606145e3d661924eb5
4
+ data.tar.gz: 5b339b76aba296d6d9ebd980b23f3b22b8e7de5b1d0f0b389c62cd945b130354
5
5
  SHA512:
6
- metadata.gz: 3ddb7a8153f7e06543c05d222f53e28c202560a05055004c39f4d5dda9f75b6d15cf824ee5cad136a7309268af9bb291bbe11c4191ccaee45266daed2918d25f
7
- data.tar.gz: 6a89cf3c0d1ffe95aedcf0e2625aafb48922f9bb4cca8d5208283efec89afac92b6ed1d21ca0dbf0093b3e38cfbb4389c4949030b02bf70784e5f16552c09b1c
6
+ metadata.gz: a71437e37acddbf781a67b1a547b215fb1a955c46b0963f2b9e76b44fb3d150b5cbbbe27659dcf6b0305aa5af62ea3c0923b1b45be93129696404995b5e0a65f
7
+ data.tar.gz: 9358d9d0c5902d7dbf732bfb4d5bce927da9c57289c5d44f37a349e0e81da6623c815f9899c5bfa2531df9e1f8fd955eeec73ef2f8f45cb7a9ab95febb41e97a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- field_mask_parser (0.4.1)
4
+ field_mask_parser (0.4.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -43,5 +43,17 @@ module FieldMaskParser
43
43
  has_manies: @has_manies.map(&:to_h),
44
44
  }
45
45
  end
46
+
47
+ def to_paths(prefix: [], sort: true)
48
+ r = []
49
+ attrs.each do |attr|
50
+ r << (prefix + [attr]).join(".")
51
+ end
52
+ assocs.each do |assoc|
53
+ r += assoc.to_paths(prefix: prefix + [assoc.name], sort: false)
54
+ end
55
+ r.sort! if sort
56
+ r
57
+ end
46
58
  end
47
59
  end
@@ -1,3 +1,3 @@
1
1
  module FieldMaskParser
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: field_mask_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nao Minami
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-06 00:00:00.000000000 Z
11
+ date: 2018-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler