deimos-ruby 1.12.0 → 1.12.1
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/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/deimos/schema_class/base.rb +4 -9
- data/lib/deimos/schema_class/record.rb +7 -0
- data/lib/deimos/utils/schema_class.rb +1 -1
- data/lib/deimos/version.rb +1 -1
- data/spec/consumer_spec.rb +1 -1
- 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: 456ac47b0f41a41e874a109a005d50650ffc36ae0ca9e924f5e06a0c1b7599ef
|
4
|
+
data.tar.gz: 14f3e9591b4a32ea503bd063416d13cdd3625bcd220bbe6f61675f1fb911afe6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5f0f9e5d2e0e68c42102166490a929602ef0327c84d42f987200c5c7c941135b7120ca18827707d056a57e9e9ee6e923a7bba91df84f5b7873f1b24e96597f6
|
7
|
+
data.tar.gz: ad75c79468a87c1a68658099ce9234730926cc049897febd797b2bedbfea316b5ff5b51a8fe215afbd087cf90ca93f2c292b9733128e5470f09cf3e3120d7cce
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## UNRELEASED
|
9
9
|
|
10
|
+
# 1.12.1 - 2021-11-02
|
11
|
+
|
12
|
+
- ### Fixes :wrench:
|
13
|
+
- Fixed issue where Schema Class Consumer/Producer are using `Deimos::` instead of `Schema::` for instances of classes.
|
14
|
+
|
10
15
|
# 1.12.0 - 2021-11-01
|
11
16
|
|
12
17
|
### Features :star:
|
data/Gemfile.lock
CHANGED
@@ -17,7 +17,7 @@ module Deimos
|
|
17
17
|
to_h.to_json
|
18
18
|
end
|
19
19
|
|
20
|
-
# Converts the object to a hash which can be used for debugging.
|
20
|
+
# Converts the object to a hash which can be used for debugging or comparing objects.
|
21
21
|
# @return [Hash] a hash representation of the payload
|
22
22
|
def as_json(_opts={})
|
23
23
|
JSON.parse(to_json)
|
@@ -33,10 +33,10 @@ module Deimos
|
|
33
33
|
def ==(other)
|
34
34
|
comparison = other
|
35
35
|
if other.class == self.class
|
36
|
-
comparison = other.
|
36
|
+
comparison = other.as_json
|
37
37
|
end
|
38
38
|
|
39
|
-
comparison == self.
|
39
|
+
comparison == self.as_json
|
40
40
|
end
|
41
41
|
|
42
42
|
# :nodoc:
|
@@ -53,14 +53,9 @@ module Deimos
|
|
53
53
|
|
54
54
|
protected
|
55
55
|
|
56
|
-
# :nodoc:
|
57
|
-
def state
|
58
|
-
as_json
|
59
|
-
end
|
60
|
-
|
61
56
|
# :nodoc:
|
62
57
|
def hash
|
63
|
-
|
58
|
+
as_json.hash
|
64
59
|
end
|
65
60
|
end
|
66
61
|
end
|
@@ -7,6 +7,13 @@ module Deimos
|
|
7
7
|
module SchemaClass
|
8
8
|
# Base Class of Record Classes generated from Avro.
|
9
9
|
class Record < Base
|
10
|
+
|
11
|
+
# Converts the object to a hash which can be used for debugging or comparing objects.
|
12
|
+
# @return [Hash] a hash representation of the payload
|
13
|
+
def as_json(_opts={})
|
14
|
+
super.except('payload_key')
|
15
|
+
end
|
16
|
+
|
10
17
|
# Element access method as if this Object were a hash
|
11
18
|
# @param key[String||Symbol]
|
12
19
|
# @return [Object] The value of the attribute if exists, nil otherwise
|
@@ -10,7 +10,7 @@ module Deimos
|
|
10
10
|
# @param schema [String]
|
11
11
|
# @return [Deimos::SchemaClass::Record]
|
12
12
|
def instance(payload, schema)
|
13
|
-
klass = "
|
13
|
+
klass = "Schemas::#{schema.underscore.camelize}".safe_constantize
|
14
14
|
return payload if klass.nil? || payload.nil?
|
15
15
|
|
16
16
|
klass.new(**payload.symbolize_keys)
|
data/lib/deimos/version.rb
CHANGED
data/spec/consumer_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deimos-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Orner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avro_turf
|