evt-schema 2.2.3.0 → 2.2.4.4
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 +5 -0
- data/lib/schema/schema.rb +7 -0
- 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: 419b0a88016cd2abf3ae86bc41f2c682370e87209b9592763db24bb88c1c871f
|
4
|
+
data.tar.gz: f79482d22091e62a0afa722e1c817a15a6739abf7280ce47293da644681831ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99f3be758df750f2e158c29e4f5fee8e6b2716cce4f05bf4bf2430f3f9d5cfc8b362f12765bdc30d2f206843729f7ff2d4de75de21ceff330782b02608566146
|
7
|
+
data.tar.gz: 5d62add3d97b9b8dd451b443bad60326144b85a6ebf00f4b7906190100a8f704fa67b9394f2bf33fd17714232a5e756c3a3ccda9ef8b2b937464d476ef55fe4a
|
@@ -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
|
data/lib/schema/schema.rb
CHANGED
@@ -3,6 +3,7 @@ module Schema
|
|
3
3
|
|
4
4
|
def self.included(cls)
|
5
5
|
cls.class_exec do
|
6
|
+
extend Info
|
6
7
|
extend AttributeMacro
|
7
8
|
extend Attributes
|
8
9
|
|
@@ -13,6 +14,12 @@ module Schema
|
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
17
|
+
module Info
|
18
|
+
def type
|
19
|
+
name.split('::').last
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
16
23
|
module AttributeMacro
|
17
24
|
def attribute_macro(attribute_name, type=nil, strict: nil, default: nil)
|
18
25
|
if type.nil? && !strict.nil?
|
@@ -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.4.4
|
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-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-attribute
|