evt-schema 2.2.7.2 → 2.2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/schema/schema.rb +14 -9
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ba3db2edbbe435d203deacf8e1adf8371126f4233496668a4a3bf64e0f9b7b9
4
- data.tar.gz: 327690e6aac9bf21458776935ab4213d62b45bf109290bcb416ac18fea0912de
3
+ metadata.gz: 94736ae92e68e59dfefff646d9badab3e2cfaca3473e73ca63a9f89a955642df
4
+ data.tar.gz: 493fb2b4ead8fb99964f5af02b153f8e4d0c59184fd2bd62799165817c627ef6
5
5
  SHA512:
6
- metadata.gz: 7244b65f846380ea41de0f6b19ed6c1bac4b67ca7843e6e0ea20903627904c58879a3d703f4cd5f35caa23e4b5569cb8a7948523ea18bba02d5cf304ed6f6b06
7
- data.tar.gz: 8d7418966296aa94c6df0bc79abc30b8d2e06e8cdd46bcc8a65f20fbd92052b1d763a0596951011aaaaf10273931b9f4082cbb8972381aedbfe86a446b3192a9
6
+ metadata.gz: 7d51cd1ee0d54afba9729353363db0a3dc19c70c88b641dea84a34c68c16664e2ddf8b82189c4aa3c2a53961733f39931c45eca8d65d4541b469a9ffe7e04fd6
7
+ data.tar.gz: ac1509e0206ea9b2ba30721101cf0d6dc9010b5978f9c85f17fc17e2220bcd697f8c02d0bbbfae41123545a54f4bb55e0178b41362f333c6eecc1dc9fee68df8
@@ -161,22 +161,27 @@ module Schema
161
161
  end
162
162
  end
163
163
 
164
- def attributes
165
- transient_attributes = []
166
- if self.class.respond_to?(:transient_attributes)
167
- transient_attributes = self.class.transient_attributes
168
- end
164
+ def attributes(include_transient: nil)
165
+ include_transient ||= false
166
+
167
+ attribute_names = self.class.attribute_names(include_transient: include_transient)
169
168
 
170
- data = self.class.attributes.each_with_object({}) do |attribute, attributes|
171
- next if transient_attributes.include?(attribute.name)
172
- attributes[attribute.name] = public_send(attribute.name)
169
+ data = attribute_names.each_with_object({}) do |attribute_name, attributes|
170
+ attributes[attribute_name] = public_send(attribute_name)
173
171
  end
174
172
 
175
173
  transform_write(data)
176
174
 
177
175
  data
178
176
  end
179
- alias :to_h :attributes
177
+
178
+ def to_h
179
+ attributes
180
+ end
181
+
182
+ def all_attributes
183
+ attributes(include_transient: true)
184
+ end
180
185
 
181
186
  def ==(other, attributes_names=nil, ignore_class: nil)
182
187
  comparison = Compare.(self, other, attributes_names)
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.7.2
4
+ version: 2.2.8.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-23 00:00:00.000000000 Z
11
+ date: 2020-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-attribute