evt-schema 2.3.0.1 → 2.3.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f332c2468a6e32cfd2cfdcdea372f004c620ca7679ad146ed8c63f66d851dbc0
4
- data.tar.gz: 3bd8893da9e6c466bba9175747402531f56df1f9cf32644297231bd1de0c502e
3
+ metadata.gz: 6b428a68d93f45e5bd364e815d925c82645e38025fc00c9204ae9b3e0f4f09b1
4
+ data.tar.gz: 39063eab4c9e83332a4963b1cb5a640279b245f9355d39783b368ba94bdf469b
5
5
  SHA512:
6
- metadata.gz: c1a631fe2dbf4dba122f20a1fe81d8afe5b95e93297f4e0009e3e9afb907544f1f276b40e96adc5e364d387a527c1a0258251ee33abeb41c4d10463439405351
7
- data.tar.gz: 29626ec60e70ac92def2e729a7097e2207ebdd96ca5c717129b78e64ab2db6e2c8fb64600b3a802ca46d074108d8ea30cbf818226e9972aaccf1635eae9513db
6
+ metadata.gz: 4e2d106b624da65230439ba3d62b8c8ba162b60ed60d03506753c4fe6da9c176a8ede38fa587bdeeeca858354d3fd15f539c5c476a26a2d4d70160f2eab7b43d
7
+ data.tar.gz: fac1fd85a1cfa3bdb9f4bb2577e5f3548fe254b61c099ee7adf55ac04e4ce39a0fa99ba46726949d29e5f5164cc8b280e16b3d3ae0bbe61fc92e8841e6487fdc
@@ -27,6 +27,7 @@ module Schema
27
27
 
28
28
  class Example
29
29
  include ::Schema::DataStructure
30
+
30
31
  attribute :some_attribute
31
32
  end
32
33
 
@@ -66,7 +67,11 @@ module Schema
66
67
  example
67
68
  end
68
69
 
69
- class Example < DataStructure::Example
70
+ class Example
71
+ include ::Schema::DataStructure
72
+
73
+ attribute :some_attribute
74
+
70
75
  def transform_read(data)
71
76
  data[:some_attribute] = 'some read value'
72
77
  end
@@ -91,7 +96,11 @@ module Schema
91
96
  example
92
97
  end
93
98
 
94
- class Example < DataStructure::Example
99
+ class Example
100
+ include ::Schema::DataStructure
101
+
102
+ attribute :some_attribute
103
+
95
104
  def transform_in(data)
96
105
  data[:some_attribute] = 'some read value'
97
106
  end
@@ -107,6 +116,10 @@ module Schema
107
116
  Error = Class.new(RuntimeError)
108
117
 
109
118
  class Example < DataStructure::Example
119
+ include ::Schema::DataStructure
120
+
121
+ attribute :some_attribute
122
+
110
123
  def transform_read(data)
111
124
  raise Error
112
125
  end
data/lib/schema/schema.rb CHANGED
@@ -161,14 +161,23 @@ module Schema
161
161
  end
162
162
  end
163
163
 
164
+ def raw_attributes
165
+ all_attribute_names = self.class.all_attribute_names
166
+ get_attributes(all_attribute_names)
167
+ end
168
+
169
+ def get_attributes(attribute_names)
170
+ attribute_names.each_with_object({}) do |attribute_name, attributes|
171
+ attributes[attribute_name] = public_send(attribute_name)
172
+ end
173
+ end
174
+
164
175
  def attributes(include_transient: nil)
165
176
  include_transient ||= false
166
177
 
167
178
  attribute_names = self.class.attribute_names(include_transient: include_transient)
168
179
 
169
- data = attribute_names.each_with_object({}) do |attribute_name, attributes|
170
- attributes[attribute_name] = public_send(attribute_name)
171
- end
180
+ data = get_attributes(attribute_names)
172
181
 
173
182
  transform_write(data)
174
183
 
@@ -197,4 +206,8 @@ module Schema
197
206
  !different
198
207
  end
199
208
  alias :eql? :==
209
+
210
+ def hash
211
+ [self.class, raw_attributes].hash
212
+ end
200
213
  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: 2.3.0.1
4
+ version: 2.3.1.3
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: 2022-01-29 00:00:00.000000000 Z
11
+ date: 2022-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-attribute
@@ -110,8 +110,6 @@ files:
110
110
  - lib/schema/controls/schema.rb
111
111
  - lib/schema/controls/schema/different.rb
112
112
  - lib/schema/data_structure.rb
113
- - lib/schema/fixtures
114
- - lib/schema/fixtures.rb
115
113
  - lib/schema/schema.rb
116
114
  - lib/schema/schema/attribute.rb
117
115
  - lib/schema/schema/compare.rb
data/lib/schema/fixtures DELETED
@@ -1 +0,0 @@
1
- /Users/sbellware/projects/eventide/schema-fixtures/lib/schema/fixtures
@@ -1 +0,0 @@
1
- /Users/sbellware/projects/eventide/schema-fixtures/lib/schema/fixtures.rb