evt-schema 1.1.0.1 → 1.2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/schema/controls/data_structure.rb +3 -3
- data/lib/schema/data_structure.rb +2 -2
- data/lib/schema/schema.rb +3 -3
- 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: 704a380b053fe55d1cd71897c7570349f293aade9de5cd038106f242bd6a814c
|
4
|
+
data.tar.gz: f13faebfcc2cf8af080ad6ebad304eb0fe670ae21d1cf11b5d54478179c17bbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd08ee9817ea5f2bd56c4f809fb8f6528efa284bf4bc6db199141f29117fb872e96e586a29e0bcaec92532151471d1dfb9304badfbf81927286263dd53d478e4
|
7
|
+
data.tar.gz: f416ce9890f90cf3ca14ee6ecd556cf84190f0113df8b636dcd475ea5b3ffb9e50ea8aa74b0bd30ccd47708f5a5904dd5e955190c546ee7aef369089b0d3543f
|
@@ -51,7 +51,7 @@ module Schema
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
module
|
54
|
+
module ReadAndWrite
|
55
55
|
def self.example
|
56
56
|
example = Example.new
|
57
57
|
example.some_attribute = 'some value'
|
@@ -59,11 +59,11 @@ module Schema
|
|
59
59
|
end
|
60
60
|
|
61
61
|
class Example < DataStructure::Example
|
62
|
-
def
|
62
|
+
def transform_read(data)
|
63
63
|
data[:some_attribute] = 'some read value'
|
64
64
|
end
|
65
65
|
|
66
|
-
def
|
66
|
+
def transform_write(data)
|
67
67
|
data[:some_attribute] = 'some written value'
|
68
68
|
end
|
69
69
|
end
|
@@ -10,7 +10,7 @@ module Schema
|
|
10
10
|
virtual :configure_dependencies do
|
11
11
|
configure
|
12
12
|
end
|
13
|
-
virtual :
|
13
|
+
virtual :transform_read
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -20,7 +20,7 @@ module Schema
|
|
20
20
|
strict ||= false
|
21
21
|
|
22
22
|
new.tap do |instance|
|
23
|
-
instance.
|
23
|
+
instance.transform_read(data)
|
24
24
|
set_attributes(instance, data, strict)
|
25
25
|
instance.configure_dependencies
|
26
26
|
end
|
data/lib/schema/schema.rb
CHANGED
@@ -9,8 +9,8 @@ module Schema
|
|
9
9
|
# This is done as a countermeasure for incompatibility
|
10
10
|
# between Virtual and an Assertions module
|
11
11
|
# include Virtual
|
12
|
-
# virtual :
|
13
|
-
define_method(:
|
12
|
+
# virtual :transform_write
|
13
|
+
define_method(:transform_write) {|data|}
|
14
14
|
#
|
15
15
|
|
16
16
|
const_set(:Boolean, Boolean)
|
@@ -155,7 +155,7 @@ module Schema
|
|
155
155
|
attributes[attribute.name] = public_send(attribute.name)
|
156
156
|
end
|
157
157
|
|
158
|
-
|
158
|
+
transform_write(data)
|
159
159
|
|
160
160
|
data
|
161
161
|
end
|