re_sorcery 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/re_sorcery/fielded.rb +5 -1
- data/lib/re_sorcery/version.rb +1 -1
- 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: f72b419777c7c5f2f57db936293ccb8fd1fbc7fd4b2ca5de14c21ac4be9ee7f7
|
4
|
+
data.tar.gz: 88d0385f9d01c64b0ad1e95fcb6350bb78ea301d0b6f291c0cb967b99d17a46e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fff11e2b74ec4c68f5c6de80815495583097d5fda2994a016382b93deaf4f0abe7492f292cf8a1831b514c0a68cd296680196051ca94be3b9c81a98f205489b
|
7
|
+
data.tar.gz: b4446f2fec6609d8a5042ced152cee096bbd44d3d041de781275017ee7153f6633e5eeef917f8ea8daac131f9750853d756013c4fae48bb98410a95e56f2164e
|
data/Gemfile.lock
CHANGED
data/lib/re_sorcery/fielded.rb
CHANGED
@@ -26,6 +26,10 @@ module ReSorcery
|
|
26
26
|
|
27
27
|
(@fields ||= {})[name] = { type: is(type), pro: pro }
|
28
28
|
end
|
29
|
+
|
30
|
+
def fields
|
31
|
+
(superclass&.include?(Fielded) ? superclass.send(:fields) : {}).merge(@fields || {})
|
32
|
+
end
|
29
33
|
end
|
30
34
|
|
31
35
|
def self.included(base)
|
@@ -39,7 +43,7 @@ module ReSorcery
|
|
39
43
|
#
|
40
44
|
# @return [Result<String, Hash>]
|
41
45
|
def fields
|
42
|
-
self.class.
|
46
|
+
self.class.send(:fields).inject(ok({})) do |result_hash, (name, field_hash)|
|
43
47
|
result_hash.assign(name) do
|
44
48
|
field_hash[:type].test(instance_exec(&field_hash[:pro]))
|
45
49
|
.and_then { |tested| ExpandInternalFields.expand(tested) }
|
data/lib/re_sorcery/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: re_sorcery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Spencer Christiansen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|