evt-schema 2.2.6.0 → 2.2.6.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 +4 -4
- data/lib/schema/controls/schema.rb +14 -5
- data/lib/schema/schema.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9299b9d03473151d2ac17454be8a3fa58a77ff2db066742d5930960b041340a1
|
4
|
+
data.tar.gz: b414f51b769f2efad19b78af1b4c3e8ac31ae855516f303de78c2d464e60a666
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e1dd9b3f459e6134c596674b634db32020767278ed6fd59283cc51c920bfc228d1b0e657e17450b06e552b568d2407218d22b3537b43fba57b4a2759da53a80
|
7
|
+
data.tar.gz: be27088bda8b35cc4ac9b507d89513fb6705b430040145d4e062492253b2884b52c60f2352705744088a21a9dc316243153c09fa2748ef25bc217071cbe3e5f8
|
@@ -124,11 +124,20 @@ module Schema
|
|
124
124
|
attribute :some_other_attribute
|
125
125
|
end
|
126
126
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
127
|
+
class Primitive
|
128
|
+
include ::Schema
|
129
|
+
attribute :some_attribute, default: 11
|
130
|
+
attribute :some_other_attribute
|
131
|
+
end
|
132
|
+
|
133
|
+
class Proc
|
134
|
+
include ::Schema
|
135
|
+
attribute :some_attribute, default: proc { 'some default value' }
|
136
|
+
end
|
137
|
+
|
138
|
+
class ObjectReference
|
139
|
+
include ::Schema
|
140
|
+
attribute :some_attribute, default: []
|
132
141
|
end
|
133
142
|
end
|
134
143
|
|
data/lib/schema/schema.rb
CHANGED
@@ -62,7 +62,7 @@ module Schema
|
|
62
62
|
if default.is_a? Proc
|
63
63
|
initialize_value = default
|
64
64
|
elsif !default.nil?
|
65
|
-
initialize_value = proc { default }
|
65
|
+
initialize_value = proc { default.clone }
|
66
66
|
end
|
67
67
|
|
68
68
|
::Attribute::Define.(self, attribute_name, :accessor, check: check, &initialize_value)
|