core-state 0.1.6 → 0.1.8

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: 4d8e18bc4a17547fa9177a538b991388f3e98dd37dcb98e6d87e76ac56c10b67
4
- data.tar.gz: 9f6662fa3ed3d8c45495c5f3d07135e84323ea929d0725c2292b0fc3cdcb5b6a
3
+ metadata.gz: bc77a1d51f01d64addaf2f51e786ebd3fb34e3b872a93b77784b7b37d4ae215e
4
+ data.tar.gz: 6bdf81604e1630610ba65165b555f297f51b2939babadd7758048a40cce60771
5
5
  SHA512:
6
- metadata.gz: ea6cbfec043568a05545f37a06407b869c484072043b45a16d7c6d7e52bfed2e00f9b6629c8ac14d898f4970c3415f4d286350f86fab8573cf2184c2ec227a3c
7
- data.tar.gz: 86e0e24ac6324a28ddcf1153e10cfb5f65efe06a79240fef3d159f4bf851ebb1d81e2a8e6b0bb7aa496ddc7116faaae657aa1da06b1b7cf88bd91aea39a86b32
6
+ metadata.gz: 4ccc3ca6537fb926e2dd91471911299ed279bc6e9d675d1792afe5ec8abdbffeff768c6f4ec938658b262a33e90737ce371b2a59d62f56a2ea5411dafd355c38
7
+ data.tar.gz: b10328010f5089ab9d38491b3231301d62ea1e87788d730ae67b1e4fb3ff9523c1829c214c2a7911bbd466845e72d3d073cc7c2649d403549c529b19e0211e35
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [v0.1.8](https://github.com/metabahn/corerb/releases/tag/2023-05-07)
2
+
3
+ *released on 2023-05-07*
4
+
5
+ * `fix` [#132](https://github.com/bryanp/corerb/pull/132) Fix state inheritence ([bryanp](https://github.com/bryanp))
6
+
7
+ ## [v0.1.7](https://github.com/metabahn/corerb/releases/tag/2021-11-23.1)
8
+
9
+ *released on 2021-11-23*
10
+
11
+ * `chg` [#109](https://github.com/metabahn/corerb/pull/109) Prefer `__send__` to `send` ([bryanp](https://github.com/bryanp))
12
+
1
13
  ## [v0.1.6](https://github.com/metabahn/corerb/releases/tag/2021-11-02)
2
14
 
3
15
  *released on 2021-11-02*
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Core
4
4
  module State
5
- VERSION = "0.1.6"
5
+ VERSION = "0.1.8"
6
6
 
7
7
  def self.version
8
8
  VERSION
data/lib/is/stateful.rb CHANGED
@@ -181,12 +181,12 @@ module Is
181
181
  def inherited(subclass)
182
182
  defined_state.each_pair do |name, state|
183
183
  if state[:class]
184
- subclass.instance_variable_set(name, state[:value])
184
+ subclass.instance_variable_set(name, instance_variable_get(name))
185
185
  end
186
186
  end
187
187
 
188
- subclass.send(:prepend_defined_state_modules)
189
- subclass.instance_variable_set("@__defined_state__", @__defined_state__.each_with_object({}) { |(key, value), state|
188
+ subclass.__send__(:prepend_defined_state_modules)
189
+ subclass.instance_variable_set(:@__defined_state__, @__defined_state__.each_with_object({}) { |(key, value), state|
190
190
  state[key] = value.dup
191
191
  })
192
192
 
@@ -240,7 +240,7 @@ module Is
240
240
  extends :implementation, prepend: true do
241
241
  def initialize(...)
242
242
  self_class = self.class
243
- self_class.send(:defined_state).each_pair do |name, state|
243
+ self_class.__send__(:defined_state).each_pair do |name, state|
244
244
  if state[:instance]
245
245
  if state[:class]
246
246
  instance_variable_set(name, self_class.instance_variable_get(name))
@@ -264,7 +264,7 @@ module Is
264
264
  # [public] Safely mutates state by name, yielding a copy of the current value to the block.
265
265
  #
266
266
  def mutate_state(name, &block)
267
- send("#{name}=", block.call(send(name)))
267
+ __send__("#{name}=", block.call(__send__(name)))
268
268
  end
269
269
 
270
270
  private def defined_state_isolations
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.6
4
+ version: 0.1.8
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-02 00:00:00.000000000 Z
11
+ date: 2023-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: core-extension
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  requirements: []
71
- rubygems_version: 3.2.22
71
+ rubygems_version: 3.4.12
72
72
  signing_key:
73
73
  specification_version: 4
74
74
  summary: Easily manage object state.