opt_struct 1.5.1 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/opt_struct/class_methods.rb +9 -2
- data/lib/opt_struct/instance_methods.rb +1 -1
- data/lib/opt_struct/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz: '
|
3
|
+
metadata.gz: e02d02b33fd0c94b79f6e08079fdd1df45deb62fae647d764fd72d6703b6eb00
|
4
|
+
data.tar.gz: '06682687240b5cd22eddb32f0ca2b5682eee3c701f96b769b77dc9343df41463'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43728c868888b3f3506ae75c49a25c01b67bb8e2ff49f58f0944fdda7d37549f9f3f33bf88a6b3fde6ff8ed1add1ea846fbd40439e19c0c4e46384379bc44d9a
|
7
|
+
data.tar.gz: b6546f89c3d8b82167afb694eb2589db67c431d77af45cf6874b4d87d9907a5944fb87088ff7e57e3a899a9cc5594bda50e4fc71ed91181a7d40e883a2b43324
|
@@ -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
|
7
|
-
|
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
|
data/lib/opt_struct/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opt_struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carl Zulauf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Struct with support for keyword params and mixin support
|
14
14
|
email:
|
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '0'
|
45
45
|
requirements: []
|
46
|
-
rubygems_version: 3.
|
46
|
+
rubygems_version: 3.4.22
|
47
47
|
signing_key:
|
48
48
|
specification_version: 4
|
49
49
|
summary: The Option Struct
|