field_masked_model 0.2.1 → 0.3.0

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: 979adcce46c3f04897e9803e28edb1d99cd13f39c8a56379265efe21b0d31644
4
- data.tar.gz: 15d382af15602a920594796633d03405cc371d0919e4f7b09c2201c6677fb5ae
3
+ metadata.gz: b78a602bb5b978858cdc84253a7dd046783af730f2874c833810bb1184a7d8aa
4
+ data.tar.gz: 9b016cdf07c046ea12a98cfaa83c7f38e1119f18d59f2b880dcd5a84e5ef54ec
5
5
  SHA512:
6
- metadata.gz: 9d79eb5b69069e03773ffd32eaf056a41f1357487c9605524095e1afd2666076487a1e8b7fc297c9e8a7aa02134c301259964a35764a2f0eb2ed3f9471d826c3
7
- data.tar.gz: 19ad31fba8d2f4c3cec3da298c496071d12b2f3f70ff5d59f2447a4eb934bc559c57e46d875f300e36cb132d390e9a7e73c0c09eb14e1773b11dca1b266a36cd
6
+ metadata.gz: 265bc702e5ec99c1e48b59ca36c6c2d47f99a4c89ee86ce348dc66eabec73320172398ee4d856e4c11935967ce2350cef9e74a2872d07fae416a8655713191f5
7
+ data.tar.gz: aa0100dcfa178f18df044f4a6ce00b1d06706cf189bba2955858e34822eab4b886fe61b0a8d383d01968b87a4d6db5afd4939a1ebb4ca1e2a7a39c0926a68693
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- field_masked_model (0.2.1)
4
+ field_masked_model (0.3.0)
5
5
  fmparser (= 0.1.0)
6
6
  google-protobuf (~> 3.7)
7
7
 
@@ -11,7 +11,7 @@ GEM
11
11
  coderay (1.1.2)
12
12
  diff-lcs (1.3)
13
13
  fmparser (0.1.0)
14
- google-protobuf (3.8.0-universal-darwin)
14
+ google-protobuf (3.9.0)
15
15
  method_source (0.9.2)
16
16
  pry (0.12.2)
17
17
  coderay (~> 1.1.0)
@@ -1,12 +1,27 @@
1
1
  require "google/protobuf/timestamp_pb"
2
+ require "google/protobuf/wrappers_pb"
2
3
 
3
4
  module FieldMaskedModel
4
5
  module AttributeConverter
6
+ NULLABLE_TYPES = [
7
+ Google::Protobuf::DoubleValue,
8
+ Google::Protobuf::FloatValue,
9
+ Google::Protobuf::Int64Value,
10
+ Google::Protobuf::UInt64Value,
11
+ Google::Protobuf::Int32Value,
12
+ Google::Protobuf::UInt32Value,
13
+ Google::Protobuf::BoolValue,
14
+ Google::Protobuf::StringValue,
15
+ Google::Protobuf::BytesValue,
16
+ ].freeze
17
+
5
18
  class << self
6
19
  def convert(value)
7
20
  case value
8
21
  when Google::Protobuf::Timestamp
9
22
  timestamp_to_time(value)
23
+ when *NULLABLE_TYPES
24
+ value.value
10
25
  else
11
26
  # TODO(south37) Add conversion logic of other classes
12
27
  value
@@ -1,3 +1,3 @@
1
1
  module FieldMaskedModel
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: field_masked_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nao Minami
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-24 00:00:00.000000000 Z
11
+ date: 2019-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler