vident 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vident/attributes/typed.rb +7 -8
- data/lib/vident/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb36bbcf0d3a46ec51c1a68e80dbf0ef4b85076412591d30215779d1ff2816e8
|
4
|
+
data.tar.gz: 6c4b6f98a4ac9bcbebaea4003a6532231a2e188aa94ec34889f4c1c624c9ae46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ccf024bee94cccffccc5b8cf7999b0b1b2e47c1a4185ab2f5a2f5129b7494d66cdde1d7d8ee8364123386dedd3f1f15ae60c27798db73cea3be4f22f68b24f6
|
7
|
+
data.tar.gz: f09643a2d324a23012b5466b6bd7ad4a205f21238441891557a8d60d5a71860f5a64e866366bdb63744a62f6d7efed53bdfcb17f5711eab54e35675cefd60f88
|
@@ -96,12 +96,12 @@ if Gem.loaded_specs.has_key? "dry-struct"
|
|
96
96
|
options[:delegates] != false
|
97
97
|
end
|
98
98
|
|
99
|
-
def define_on_schema(
|
99
|
+
def define_on_schema(attribute_name, type_info, options)
|
100
100
|
@attribute_ivar_names ||= {}
|
101
|
-
@attribute_ivar_names[
|
102
|
-
define_attribute_delegate(
|
103
|
-
@schema ||= Class.new(Vident::Attributes::TypedNilingStruct)
|
104
|
-
@schema.attribute
|
101
|
+
@attribute_ivar_names[attribute_name] = :"@#{attribute_name}"
|
102
|
+
define_attribute_delegate(attribute_name) if delegates?(options)
|
103
|
+
@schema ||= const_set("TypedSchema", Class.new(Vident::Attributes::TypedNilingStruct))
|
104
|
+
@schema.attribute attribute_name, type_info
|
105
105
|
end
|
106
106
|
|
107
107
|
def define_attribute_delegate(attr_name)
|
@@ -135,10 +135,9 @@ if Gem.loaded_specs.has_key? "dry-struct"
|
|
135
135
|
type, subtype = extract_member_type_and_subclass(signature, options)
|
136
136
|
dry_type = dry_type_from_primary_type(type, strict, converter)
|
137
137
|
if subtype && dry_type.respond_to?(:of)
|
138
|
+
subtype_info = dry_type_from_primary_type(subtype, strict, converter)
|
138
139
|
# Sub types of collections currently can be nil - this should be an option
|
139
|
-
dry_type.of(
|
140
|
-
map_primitive_to_dry_type(subtype, options, converter).optional.meta(required: false)
|
141
|
-
)
|
140
|
+
dry_type.of(subtype_info.optional.meta(required: false))
|
142
141
|
else
|
143
142
|
dry_type
|
144
143
|
end
|
data/lib/vident/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vident
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Ierodiaconou
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|