evt-schema 1.2.0.1 → 1.2.2.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.rb +0 -1
- data/lib/schema/schema.rb +25 -6
- data/lib/schema/schema/assertions.rb +1 -0
- 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: bb4716312607b047f05ccc6c3992228740e8c07be998f66991c82a535ca2916a
|
4
|
+
data.tar.gz: c12042426194c4b2de2e382f1191d62d5a5e4f43068465ce63e02db3d7599da8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 815d23bd66d652b8b69acf5786a6fa3bef1be7f67c130cd63bcad0350cdae74a8ef35bc13391de7e6069df68572e7c47e4abf363fb8bb697af0640050efa550b
|
7
|
+
data.tar.gz: 6f9bb75f9d6304b71c2d15bc62c43fc90600b7b10728ff5c1ca08a19700073d9bc2ce21228bacd7df13a5e94527a0644e69d7bd643dc5320d4fedeeb096acd27
|
data/lib/schema.rb
CHANGED
data/lib/schema/schema.rb
CHANGED
@@ -6,12 +6,8 @@ module Schema
|
|
6
6
|
extend AttributeMacro
|
7
7
|
extend Attributes
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
# include Virtual
|
12
|
-
# virtual :transform_write
|
13
|
-
define_method(:transform_write) {|data|}
|
14
|
-
#
|
9
|
+
include Virtual
|
10
|
+
virtual :transform_write
|
15
11
|
|
16
12
|
const_set(:Boolean, Boolean)
|
17
13
|
end
|
@@ -188,4 +184,27 @@ module Schema
|
|
188
184
|
def ===(other)
|
189
185
|
self.eql?(other, ignore_class: true)
|
190
186
|
end
|
187
|
+
|
188
|
+
def attributes_equal?(other, attributes=nil, print: nil)
|
189
|
+
attributes ||= self.class.attribute_names
|
190
|
+
|
191
|
+
print = true if print.nil?
|
192
|
+
print ||= false
|
193
|
+
|
194
|
+
equal = self.eql?(other, attributes, ignore_class: true)
|
195
|
+
|
196
|
+
if !equal && print
|
197
|
+
attributes = Array(attributes)
|
198
|
+
|
199
|
+
require 'pp'
|
200
|
+
puts "self: #{self.class.name}"
|
201
|
+
pp self.attributes.select { |k, v| attributes.include? k }
|
202
|
+
puts "other #{other.class.name}:"
|
203
|
+
pp other.attributes.select { |k, v| attributes.include? k }
|
204
|
+
puts "attributes:"
|
205
|
+
attributes.each { |a| puts a.inspect}
|
206
|
+
end
|
207
|
+
|
208
|
+
equal
|
209
|
+
end
|
191
210
|
end
|
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: 1.2.0
|
4
|
+
version: 1.2.2.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: 2019-10-
|
11
|
+
date: 2019-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-attribute
|