core-state 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/core/state/version.rb +1 -1
- data/lib/is/stateful.rb +11 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c21289439e5a70015dc1fad5f146ce0742296965b142b7e1a358195a4eeae7e
|
4
|
+
data.tar.gz: c02f0889fd523fcb34c865b2dd3232a2bd2bce51c0211bff5f21c14aef848daa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 753c19c8d932f869ab172136b3772e70502969ed4c702317c61de491d2fe52da8b6a6b32a1e5b00b02535e0a46bd0f3d33e62b56fa1862c7e6c2c6803fe3da84
|
7
|
+
data.tar.gz: f660e4cc842ef45e30b6ee665af5a4a8aa33de9c170e3852afb8bf4c5cd5fd5cf21b028be78927761e1febd2859655a3257d50e9870345469934a9146e94a534
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## [v0.1.4](https://github.com/metabahn/corerb/releases/tag/2021-09-30)
|
2
|
+
|
3
|
+
*released on 2021-09-30*
|
4
|
+
|
5
|
+
* `fix` [#85](https://github.com/metabahn/corerb/pull/85) Initialize with class-level state when available ([bryanp](https://github.com/bryanp))
|
6
|
+
|
1
7
|
## [v0.1.3](https://github.com/metabahn/corerb/releases/tag/2021-09-28)
|
2
8
|
|
3
9
|
*released on 2021-09-28*
|
data/lib/core/state/version.rb
CHANGED
data/lib/is/stateful.rb
CHANGED
@@ -122,6 +122,10 @@ module Is
|
|
122
122
|
defined_state[ivar_name] = state
|
123
123
|
defined_state_isolations << ivar_name
|
124
124
|
|
125
|
+
if state[:class]
|
126
|
+
instance_variable_set(ivar_name, default)
|
127
|
+
end
|
128
|
+
|
125
129
|
prefix = if private
|
126
130
|
"private "
|
127
131
|
else
|
@@ -239,9 +243,14 @@ module Is
|
|
239
243
|
|
240
244
|
extends :implementation, prepend: true do
|
241
245
|
def initialize(...)
|
242
|
-
self.class
|
246
|
+
self_class = self.class
|
247
|
+
self_class.send(:defined_state).each_pair do |name, state|
|
243
248
|
if state[:instance]
|
244
|
-
|
249
|
+
if state[:class]
|
250
|
+
instance_variable_set(name, self_class.instance_variable_get(name))
|
251
|
+
else
|
252
|
+
instance_variable_set(name, state[:value])
|
253
|
+
end
|
245
254
|
end
|
246
255
|
end
|
247
256
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: core-state
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Powell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: core-extension
|