json_schematize 0.11.0 → 0.12.0

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: 4a137c2d8b5ad986a86ac234f6c03802af2c175b06fc85ff69cf57794a378cca
4
- data.tar.gz: b449ba15bc26b4f3026d8904bb25a76bcbd26e8ac50ab40deee36f6c1e165544
3
+ metadata.gz: d0109f08060b1b724a2eac694e1cc96c54c3b7bf777b34c247cda4d4e23a4285
4
+ data.tar.gz: e97e0ac77e38320befb81841f3ef46162d89aba94563cc5b0c51c7cae8f72642
5
5
  SHA512:
6
- metadata.gz: 18739039d4c14428e0ec8ad33ed4b229669cceb8cecb11fa851e13a7ca04eb73a78c2faf0bfd34b49957cea90494d1fecd0d31c94c76ea67afc798007ca08288
7
- data.tar.gz: 8b51b98b196a7f1a106c409fb957aa259a5751e07d7ae18b823a1439f877987f359a91eb53bd6ff2d1a597fd9e91dafa307f3eb7beef890427eef44267701b5f
6
+ metadata.gz: 68d0341cf925a9571bd132e03fe75741dc1bd70de88bc706133c29be46b71b22da623c4963c810c33490dcc553d54c7711ac9390d776a52e4161b7a743e405a9
7
+ data.tar.gz: 8df6e7e5bd39c186cfa5d41649fda427ac86a470fabe766d886a02f7f9165c3b6bd68ce18cfd54809be3dbabd0805be6e62a2b392c691bbbd6516bc3e27fe42e
@@ -20,7 +20,13 @@ module JsonSchematize::FieldTransformations
20
20
 
21
21
  @converter = DEFAULT_CONVERTERS[@acceptable_types[0]]
22
22
  if @converter.nil?
23
- @converter = ->(val) { @acceptable_types[0].new(val) }
23
+ @converter = Proc.new do |val|
24
+ if @acceptable_types[0] < JsonSchematize::Generator && @acceptable_types[0] === val
25
+ val
26
+ else
27
+ @acceptable_types[0].new(val)
28
+ end
29
+ end
24
30
  end
25
31
  end
26
32
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonSchematize
4
- VERSION = "0.11.0"
4
+ VERSION = "0.12.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_schematize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Taylor
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-28 00:00:00.000000000 Z
11
+ date: 2025-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: class_composer