wholable 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +1 -10
- data/wholable.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72a28b3df96aec9ab54375e96583424bc919c9659b2f701ab600b341d82d61b9
|
4
|
+
data.tar.gz: 898361fe5766c92fc629b7ea3d459576a902369f09fe438f3c7e5cc76ed93bf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a66ba09ec485373c4b3789203bf5a5d72d4d5438d33668f4981de9269b665ccbd81a5969f45da443149a377775762090d9926e826648b9a5f5fb5c7f72fc3d36
|
7
|
+
data.tar.gz: e0407f928f8310c4350a512ee087ab8c542ca66482cd2f2fc67c9cd996b4991aa53ac3c8ab2209c57429108b1ed743afb5f76b9ec43fc63249e0e7055e3bef0a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
= Wholable
|
12
12
|
|
13
|
-
Wholable
|
13
|
+
Wholable allows you to turn your object into a _whole value object_ by ensuring object equality is determined by the values of the object instead of by identity. Whole value objects -- or value objects in general -- have the following traits as also noted via link:https://en.wikipedia.org/wiki/Value_object[Wikipedia]:
|
14
14
|
|
15
15
|
* Equality is determined by the values that make up an object and not by link:https://en.wikipedia.org/wiki/Identity_(object-oriented_programming)[identity] (i.e. memory address) which is the default behavior for all {ruby_link} objects except for {data_link} and {structs_link}.
|
16
16
|
* Identity remains unique since two objects can have the same values but different identity. This means `BasicObject#equal?` is never overwritten -- which is strongly discouraged -- as per link:https://rubyapi.org/o/basicobject#method-i-3D-3D[BasicObject] documentation.
|
@@ -142,15 +142,6 @@ Whole values can be broken via the following:
|
|
142
142
|
* *Post Attributes*: Adding additional attributes after what is defined when including `Wholable` will break your whole value object. To prevent this, let Wholable manage this for you (easiest). Otherwise (harder), you can manually override `#==`, `#eql?`, `#hash`, `#inspect`, `#to_a`, and `#to_h` behavior at which point you don't need Wholable anymore.
|
143
143
|
* *Deep Freezing*: The automatic freezing of your instances is shallow and will not deeply freeze nested attributes. This behavior mimics the behavior of {data_link} objects.
|
144
144
|
|
145
|
-
== Influences
|
146
|
-
|
147
|
-
This implementation is based upon these original designs:
|
148
|
-
|
149
|
-
- link:https://github.com/dkubb/equalizer[Equalizer]: One of the first implementations that is over a decade old and no longer maintained.
|
150
|
-
- link:https://github.com/dry-rb/dry-equalizer[Dry Equalizer]: Deprecated and no longer maintained but was based upon the above implementation and has now moved into Dry Core.
|
151
|
-
- link:https://dry-rb.org/gems/dry-core[Dry Core]: Includes the link:https://dry-rb.org/gems/dry-core/equalizer[Dry::Core::Equalizer] module which is officially supported and actively maintained by the Dry RB team. A good alternative to this gem.
|
152
|
-
- link:https://github.com/piotrmurach/equatable/tree/master[Equatable]: A similar implementation to the above but is based off what you define via your `.attr_reader`. The project hasn't been maintained or updated in several years.
|
153
|
-
|
154
145
|
== Development
|
155
146
|
|
156
147
|
To contribute, run:
|
data/wholable.gemspec
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wholable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
|
36
36
|
gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2023-
|
38
|
+
date: 2023-10-26 00:00:00.000000000 Z
|
39
39
|
dependencies: []
|
40
40
|
description:
|
41
41
|
email:
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
|
-
rubygems_version: 3.4.
|
82
|
+
rubygems_version: 3.4.21
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: A whole value object mixin.
|
metadata.gz.sig
CHANGED
Binary file
|