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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7d6f4f732c60937fcc4e7c2834e59d7a225defbe930bfc37ac02729ddc7e092
4
- data.tar.gz: e32bbddd1e6d01ebd824b8916fc40c2eac467966e4a154875e90e9f1ab50528e
3
+ metadata.gz: 456ac47b0f41a41e874a109a005d50650ffc36ae0ca9e924f5e06a0c1b7599ef
4
+ data.tar.gz: 14f3e9591b4a32ea503bd063416d13cdd3625bcd220bbe6f61675f1fb911afe6
5
5
  SHA512:
6
- metadata.gz: 1d1b3ba943c5ac49d87f5d4f77d22d88d0e5ff5467eef5e040acb2f5f7af0ae3f4d042d8156e5a8e413c394496a6092c7a691ddb840e366bb23617f48103bd62
7
- data.tar.gz: ba8fe17bed6e62f86d87ae54b81a8a3cb57efe7fc06586166d1a59d92b87640e19f74213724f3b7404846975d77b0b016127fa8a846a4de270a1c8192f9a3344
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- deimos-ruby (1.11.0)
4
+ deimos-ruby (1.12.0)
5
5
  avro_turf (~> 0.11)
6
6
  fig_tree (~> 0.0.2)
7
7
  phobos (>= 1.9, < 3.0)
@@ -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.state
36
+ comparison = other.as_json
37
37
  end
38
38
 
39
- comparison == self.state
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
- state.hash
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 = "Deimos::#{schema.underscore.camelize}".safe_constantize
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deimos
4
- VERSION = '1.12.0'
4
+ VERSION = '1.12.1'
5
5
  end
@@ -12,7 +12,7 @@ module ConsumerTest
12
12
 
13
13
  # :nodoc:
14
14
  def fatal_error?(_exception, payload, _metadata)
15
- payload == 'fatal'
15
+ payload.to_s == 'fatal'
16
16
  end
17
17
 
18
18
  # :nodoc:
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.0
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-01 00:00:00.000000000 Z
11
+ date: 2021-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avro_turf