json_schematize 0.13.0 → 0.13.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9552a1d27f0e01792650d43063ac12637a93213cbbc46fb0c17348e35a3ea47a
4
- data.tar.gz: dd408ca6119ad543940f51f142e4e585a23e2ce32a48f435a18b457f54df8931
3
+ metadata.gz: 367ec87c9335f60b8780bfd2ebc1880f7d2edb9df149684abd975dfd4f31cde9
4
+ data.tar.gz: c1d2109dacd830fb328e9dfd5d3ad94a09aef3ff97686cc448811187e9d2318d
5
5
  SHA512:
6
- metadata.gz: 512f359cbcc10bdd7a8e78ac4d9eff35d1643e2cf915defc5d3bd1e1fde7884e194d1bc64555f8a38ee6e99c6adc8c254f26327c227aee0554cabf67678d76e8
7
- data.tar.gz: 36078bca47c415edcc7fac902b88a33d3cb339c630ace7b1e9b97e48c7bcaf3880b71755ff80beff8794b30a7c1c33c4000b9ebb4d942e9bfe2d49a8e72056f5
6
+ metadata.gz: 5834ac752744e501c6c37ae936e654c1854dd83358ec057cdf7b66a47459a5c674b4766e3e9f112507d53c9ce3782967343f841579f45d58a0425111206bc724
7
+ data.tar.gz: 04ff2397b96d60a5d07416267bb1b8a1a6a143102281c3c6f7715ff959c15f7d57a6334f0f49d5ae2243e02bcaf45c1ac79c56be6b0065a1915d1acc4bdd3bfd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- json_schematize (0.13.0)
4
+ json_schematize (0.13.1)
5
5
  class_composer (>= 1.0)
6
6
 
7
7
  GEM
@@ -5,12 +5,12 @@ module JsonSchematize::Introspect
5
5
  def to_h
6
6
  self.class.fields.map do |field|
7
7
  value = method(:"#{field.name}").()
8
- if field.array_of_types
8
+ if value.class == JsonSchematize::EmptyValue
9
+ [field.name, nil]
10
+ elsif field.array_of_types
9
11
  [field.name, value.map(&:to_h)]
10
12
  elsif value.class == Class
11
13
  [field.name, value.to_s]
12
- elsif value.class == JsonSchematize::EmptyValue
13
- [field.name, nil]
14
14
  elsif JsonSchematize::Generator > value.class
15
15
  [field.name, value.to_h]
16
16
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonSchematize
4
- VERSION = "0.13.0"
4
+ VERSION = "0.13.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_schematize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Taylor