evt-schema 2.2.3.0 → 2.2.4.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c8e31a467379493fdd3ec2e248377543c76fbc87f5f0daeb949f02db24938d9
4
- data.tar.gz: c11380e93d31f1c4b23429d6207ca5fcf096174260aadfa2e562396602eda029
3
+ metadata.gz: 419b0a88016cd2abf3ae86bc41f2c682370e87209b9592763db24bb88c1c871f
4
+ data.tar.gz: f79482d22091e62a0afa722e1c817a15a6739abf7280ce47293da644681831ac
5
5
  SHA512:
6
- metadata.gz: 266184bb8a7cb67d710d2a58dd50100089b3e75439e27231bd8a1fb667aaa6fdfb305435e71dfd2808d2ae02e88d8386f41c95f893838eb252eda8b9932ea670
7
- data.tar.gz: f470e139e28f28ad52705d974e3dc1bc314f0091cbb5c2f0a4aa9b8e20bc73e31c4734ed90b2e60934300c566de92e97f8109191442e2d9011213d9124c57bec
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
@@ -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, 'Control object is not an implementation of Schema'
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, 'Compare object is not an implementation of Schema'
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.3.0
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-09 00:00:00.000000000 Z
11
+ date: 2020-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-attribute