enummify 0.2.0 → 0.3.0

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: 18c5b92dafe4aae8f25c5389749bbf671cf17facc883ec20da917d3f8750f786
4
- data.tar.gz: f7becca7d6149d08d7be46e67a541117e11ab892258b16286d9820b50eb48e29
3
+ metadata.gz: 95f108954151ebeaec33100a3d0a8efc41b1b8fe6d6b8ddca266bbad74528e39
4
+ data.tar.gz: aa6272903401b74b75d36ec01e62060aae86fc848db859059cfb0cc1d813be0a
5
5
  SHA512:
6
- metadata.gz: 55776b3e75d317357a17c8985571e98df46b3c99647de0f4ebc7ec2481a1b35cf68cf567342defcc18bad39b016f0d21231cc94914fa176021bcd5f0024d4792
7
- data.tar.gz: 0502c8821c91c4157658ebe143ac7936e9a2d542a33d2eeb6feb7c382885c2551457b31eb0bc43fe040d2951c9993cb5c3d7b440de394b3a5f0c2c92bb18f6d2
6
+ metadata.gz: ed4c10641a579a2b34e93e04e9ae9f338ffdf5b7c5d3389b051f7498b40aa56d026de7e2ade1ec6a9fb3f1569606a64a149c497a4c2b090111a055bdeb369aab
7
+ data.tar.gz: 202fa5de16b4e6d0df0b52ad5884850b58da068a7ac8d6c4c00167cc27d5d2e5cc872099572ce305e346c2e6f43724ffac877918e8723d5e711b374b85963f55
data/lib/enummify/enum.rb CHANGED
@@ -64,7 +64,9 @@ module Enummify
64
64
  subclass.instance_variable_set(:@serialized_to_value, {})
65
65
  end
66
66
 
67
- private_class_method :const_added, :inherited
67
+ # Members are registered only when assigned to a constant, so an instance built outside the class body would be
68
+ # unregistered and its ordinal would reach another member's slot.
69
+ private_class_method :const_added, :inherited, :new
68
70
 
69
71
  # Store only the serialized string so Marshal loading uses the registered member.
70
72
  #: (Integer) -> String
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Enummify
5
- VERSION = '0.2.0'
5
+ VERSION = '0.3.0'
6
6
  end
data/rbi/enummify.rbi CHANGED
@@ -29,6 +29,8 @@ module Enummify
29
29
  sig { returns(T::Array[T.attached_class]) }
30
30
  def self.values; end
31
31
 
32
+ private_class_method :new
33
+
32
34
  sig { params(_depth: Integer).returns(String) }
33
35
  def _dump(_depth); end
34
36
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enummify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin D. Harris