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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1955c7fa4eaf8ae64db37e57575a6da241315ebd5855d72097e8e175292d0ee3
4
- data.tar.gz: d34b3b78b78e7e27466468851e96968293e978cadfc40104e3a67425e69eb4a5
3
+ metadata.gz: 910e3c46d5bcd1d4f7bce77cc41b89468ee2a3e7fce57bd281a484eb8e114c48
4
+ data.tar.gz: 488d7ca201c5e973ae5e183154ecb917561d756af14533caa4f06b2f2889c9ac
5
5
  SHA512:
6
- metadata.gz: 125f0ff78bdf35d47b2fd7400ebb93db3a249d0b04abe1462394b732ad1d804326d7d89c7b04e0d3ca28cb738bc1f350a5091d2ae559490cfea468b864a1d03d
7
- data.tar.gz: 184cd1009cbd96af31d5fce7c075c483ce4762fc77936843c66a13df2c43b0aa95e70fe14e5e7c8ddaea1ebaf6a85084fc0345479af1e2a273cab6ca8942f64d
6
+ metadata.gz: 208de749d05602d4914bcd9257ff6d902c9bcb3882c1a44ee2f52aab6b5fa6a1889e5a98743a2b2a64f750aac1d15b373599616b82d810ad6798c53fa3e14c85
7
+ data.tar.gz: d89f379d4f35f69ab269713852194cf04b276db8d25ef08cc602deadcb7148dc03b240711cc9709f2d56a6b9a799ee2253e93d16d5b44f3da9cef45a115b73aa
@@ -6,11 +6,13 @@ on:
6
6
  - master
7
7
  paths-ignore:
8
8
  - 'README.md'
9
+ - 'CHANGELOG.md'
9
10
  push:
10
11
  branches:
11
12
  - master
12
13
  paths-ignore:
13
14
  - 'README.md'
15
+ - 'CHANGELOG.md'
14
16
 
15
17
  jobs:
16
18
  coverage:
@@ -6,11 +6,13 @@ on:
6
6
  - master
7
7
  paths-ignore:
8
8
  - 'README.md'
9
+ - 'CHANGELOG.md'
9
10
  push:
10
11
  branches:
11
12
  - master
12
13
  paths-ignore:
13
14
  - 'README.md'
15
+ - 'CHANGELOG.md'
14
16
 
15
17
  jobs:
16
18
  unit_tests:
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.2]
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.2]: https://github.com/PikachuEXE/contracted_value/compare/v0.1.1...v0.1.2
48
- [0.1.1]: https://github.com/PikachuEXE/contracted_value/compare/v0.1.0...v0.1.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
- @attr_values.store(
266
- attribute.name.to_sym,
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
- @attr_values.clone
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
- define_method(name_in_sym) { @attr_values[name_in_sym] }
310
+ attr_reader(name_in_sym)
310
311
  end
311
312
 
312
313
  # @api private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContractedValue
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contracted_value
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - PikachuEXE