opt_struct 1.5.1 → 1.5.2

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: 3513e52f9bdf75f5c2f2b59e2718b3de30cbc5e9720bd6d7b8e22eb3d23975a8
4
- data.tar.gz: '0851dbb6109b9eb2b191ae709ae08d47562e457f8dd1375084194aef3d8d00bb'
3
+ metadata.gz: d997efd436a127ccf51efc19590c55f4671c087e61ed085174a273a723d9fc66
4
+ data.tar.gz: 87f2650397718c6dad69871202ea303de8626c94d98cab01b1e14ce6e78de82e
5
5
  SHA512:
6
- metadata.gz: 40875af1558cbe95e6715d58d3dfa100f268d103a5fa1269ccbb7dcca7c2cf23b7670ff1303f5f51d6ce292320f37c7878339c7811ac810ce57ee6fa30777f2a
7
- data.tar.gz: 576629818aa2c778194587112b7965182b53b36f346a9606f518d969a57c646d0d60edf5772537600b575d1b6452c10ef5fe28b163d33ceede2e07d99427e862
6
+ metadata.gz: 8ba6acba66bd8d059d3cc210b5102908929458b6665972e7ba3c049fed4eb6ab1031edf987b0e1d30ba61130d72cf0cdd075587319016924445e075cae4e4a83
7
+ data.tar.gz: 9dd91af6395c02a480a9ffe413c1912dba17f30fc7f7e3f175f0b681d485aee8f9cbf91ac136158f6bf82942bd137e3e68082bd9d2d7ac8ba1c2d44e541f7d29
@@ -3,8 +3,15 @@ module OptStruct
3
3
  def inherited(subclass)
4
4
  # intersection of defined vars and the ones we care about
5
5
  (instance_variables & OptStruct::CLASS_IVARS).each do |ivar|
6
- # copy them to the child class
7
- subclass.send(:instance_variable_set, ivar, instance_variable_get(ivar).dup)
6
+ # copy each to the child class
7
+ value =
8
+ case ivar
9
+ when :@_callbacks # Hash that we need to duplicate deeper
10
+ instance_variable_get(ivar).transform_values(&:dup)
11
+ else
12
+ instance_variable_get(ivar).dup
13
+ end
14
+ subclass.send(:instance_variable_set, ivar, value)
8
15
  end
9
16
  super(subclass)
10
17
  end
@@ -1,3 +1,3 @@
1
1
  module OptStruct
2
- VERSION = "1.5.1"
2
+ VERSION = "1.5.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opt_struct
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Zulauf