evt-schema 2.2.4.0 → 2.2.5.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 +18 -0
- data/lib/schema/controls/schema.rb +5 -0
- data/lib/schema/data_structure.rb +10 -1
- data/lib/schema/schema.rb +5 -1
- data/lib/schema/schema/compare/comparison.rb +2 -2
- 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: 11db0e0940b27bbf03b4e30ce0e769d3997078402f7cacd3dd865798a05c011c
|
4
|
+
data.tar.gz: d6b5aefdbb44f3a0dbafe9b80cd804d6f35043f1703c74ad3b8cfc1fe200b57b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20a2f86f42dbcbf0846bfa33a9f2cf82c62028e42f1995c82188c3f3e656212edff18f63b45107cab497e421ac2879e26669dd04f489fea7992dc366ec3959e9
|
7
|
+
data.tar.gz: 77b65107b983cabc8dbac513992d7705cf03a5e460c25311c1ef3d59951df185b95ed8042f19eaea4edde790fbd1901aa68f65088e38e19d4d3564816a88e6f0
|
@@ -83,6 +83,24 @@ module Schema
|
|
83
83
|
}
|
84
84
|
end
|
85
85
|
end
|
86
|
+
|
87
|
+
module InAndOutAliases
|
88
|
+
def self.example
|
89
|
+
example = Example.new
|
90
|
+
example.some_attribute = DataStructure.some_attribute
|
91
|
+
example
|
92
|
+
end
|
93
|
+
|
94
|
+
class Example < DataStructure::Example
|
95
|
+
def transform_in(data)
|
96
|
+
data[:some_attribute] = 'some read value'
|
97
|
+
end
|
98
|
+
|
99
|
+
def transform_out(data)
|
100
|
+
data[:some_attribute] = 'some written value'
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
86
104
|
end
|
87
105
|
end
|
88
106
|
end
|
@@ -114,9 +114,14 @@ module Schema
|
|
114
114
|
end
|
115
115
|
|
116
116
|
module DefaultValue
|
117
|
+
def self.example
|
118
|
+
Example.new
|
119
|
+
end
|
120
|
+
|
117
121
|
class Example
|
118
122
|
include ::Schema
|
119
123
|
attribute :some_attribute, default: 'some default value'
|
124
|
+
attribute :some_other_attribute
|
120
125
|
end
|
121
126
|
|
122
127
|
module Proc
|
@@ -10,7 +10,11 @@ module Schema
|
|
10
10
|
virtual :configure_dependencies do
|
11
11
|
configure
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
|
+
virtual :transform_read do |data|
|
15
|
+
transform_in(data)
|
16
|
+
end
|
17
|
+
virtual :transform_in
|
14
18
|
end
|
15
19
|
end
|
16
20
|
|
@@ -34,5 +38,10 @@ module Schema
|
|
34
38
|
end
|
35
39
|
end
|
36
40
|
end
|
41
|
+
|
42
|
+
def dup
|
43
|
+
data = to_h
|
44
|
+
self.class.build(data)
|
45
|
+
end
|
37
46
|
end
|
38
47
|
end
|
data/lib/schema/schema.rb
CHANGED
@@ -28,11 +28,11 @@ module Schema
|
|
28
28
|
|
29
29
|
def self.assure_schemas(control, compare)
|
30
30
|
if not control.is_a?(Schema)
|
31
|
-
raise Error,
|
31
|
+
raise Error, "Control object is not an implementation of Schema (Control Class: #{control.class.name})"
|
32
32
|
end
|
33
33
|
|
34
34
|
if not compare.is_a?(Schema)
|
35
|
-
raise Error,
|
35
|
+
raise Error, "Compare object is not an implementation of Schema (Compare Class: #{compare.class.name})"
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-attribute
|