Skip to content

Commit 373c352

Browse files
authored
Empty class modifier (#19)
* empty value needs to be accounted for * version bump
1 parent 4b1bded commit 373c352

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
json_schematize (0.11.0)
4+
json_schematize (0.13.0)
55
class_composer (>= 1.0)
66

77
GEM

lib/json_schematize/introspect_instance_methods.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ def to_h
99
[field.name, value.map(&:to_h)]
1010
elsif value.class == Class
1111
[field.name, value.to_s]
12+
elsif value.class == JsonSchematize::EmptyValue
13+
[field.name, nil]
1214
elsif JsonSchematize::Generator > value.class
1315
[field.name, value.to_h]
1416
else

lib/json_schematize/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module JsonSchematize
4-
VERSION = "0.12.0"
4+
VERSION = "0.13.0"
55
end

0 commit comments

Comments
 (0)