contracted_value 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/coverage.yml +2 -0
- data/.github/workflows/tests.yaml +2 -0
- data/CHANGELOG.md +16 -6
- data/lib/contracted_value/core.rb +7 -6
- data/lib/contracted_value/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 910e3c46d5bcd1d4f7bce77cc41b89468ee2a3e7fce57bd281a484eb8e114c48
|
4
|
+
data.tar.gz: 488d7ca201c5e973ae5e183154ecb917561d756af14533caa4f06b2f2889c9ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 208de749d05602d4914bcd9257ff6d902c9bcb3882c1a44ee2f52aab6b5fa6a1889e5a98743a2b2a64f750aac1d15b373599616b82d810ad6798c53fa3e14c85
|
7
|
+
data.tar.gz: d89f379d4f35f69ab269713852194cf04b276db8d25ef08cc602deadcb7148dc03b240711cc9709f2d56a6b9a799ee2253e93d16d5b44f3da9cef45a115b73aa
|
data/CHANGELOG.md
CHANGED
@@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
5
|
|
6
|
-
## [Unreleased]
|
6
|
+
## [Unreleased] - NOW
|
7
7
|
|
8
8
|
### Added
|
9
9
|
|
@@ -18,7 +18,15 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
18
18
|
- Nothing
|
19
19
|
|
20
20
|
|
21
|
-
## [0.1.
|
21
|
+
## [0.1.3] - 2023-10-11
|
22
|
+
|
23
|
+
### Fixed
|
24
|
+
|
25
|
+
- Revert `Make code "Object Shape friendly"`
|
26
|
+
Strange issue discovered in an app in production environment
|
27
|
+
|
28
|
+
|
29
|
+
## [0.1.2] - 2023-10-11
|
22
30
|
|
23
31
|
### Changed
|
24
32
|
|
@@ -27,7 +35,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
27
35
|
(https://github.com/PikachuEXE/contracted_value/pull/5)
|
28
36
|
|
29
37
|
|
30
|
-
## [0.1.1]
|
38
|
+
## [0.1.1] - 2022-09-07
|
31
39
|
|
32
40
|
### Changed
|
33
41
|
|
@@ -38,11 +46,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
38
46
|
- Fix Ruby 3.x compatibility
|
39
47
|
|
40
48
|
|
41
|
-
## 0.1.0 - 2019-06-05
|
49
|
+
## [0.1.0] - 2019-06-05
|
42
50
|
|
43
51
|
### Added
|
44
52
|
|
45
53
|
- Initial release
|
46
54
|
|
47
|
-
[0.1.
|
48
|
-
[0.1.
|
55
|
+
[0.1.3]: https://github.com/PikachuEXE/contracted_value/releases/tag/v0.1.3
|
56
|
+
[0.1.2]: https://github.com/PikachuEXE/contracted_value/releases/tag/v0.1.2
|
57
|
+
[0.1.1]: https://github.com/PikachuEXE/contracted_value/releases/tag/v0.1.1
|
58
|
+
[0.1.0]: https://github.com/PikachuEXE/contracted_value/releases/tag/v0.1.0
|
@@ -238,8 +238,6 @@ module ContractedValue
|
|
238
238
|
)
|
239
239
|
end
|
240
240
|
|
241
|
-
@attr_values = {}
|
242
|
-
|
243
241
|
self.class.send(:attribute_set).each_attribute do |attribute|
|
244
242
|
attr_value = attribute.extract_value(input_attr_values_hash)
|
245
243
|
|
@@ -262,8 +260,8 @@ module ContractedValue
|
|
262
260
|
|
263
261
|
# Using symbol since attribute names are limited in number
|
264
262
|
# An alternative would be using frozen string
|
265
|
-
|
266
|
-
attribute.name
|
263
|
+
instance_variable_set(
|
264
|
+
:"@#{attribute.name}",
|
267
265
|
sometimes_frozen_attr_value,
|
268
266
|
)
|
269
267
|
end
|
@@ -274,7 +272,10 @@ module ContractedValue
|
|
274
272
|
# rubocop:enable Metrics/CyclomaticComplexity
|
275
273
|
|
276
274
|
def to_h
|
277
|
-
|
275
|
+
self.class.send(:attribute_set).
|
276
|
+
each_attribute.each_with_object({}) do |attribute, hash|
|
277
|
+
hash[attribute.name] = instance_variable_get(:"@#{attribute.name}")
|
278
|
+
end
|
278
279
|
end
|
279
280
|
|
280
281
|
# == Class interface == #
|
@@ -306,7 +307,7 @@ module ContractedValue
|
|
306
307
|
)
|
307
308
|
@attribute_set = @attribute_set.add(attr)
|
308
309
|
|
309
|
-
|
310
|
+
attr_reader(name_in_sym)
|
310
311
|
end
|
311
312
|
|
312
313
|
# @api private
|