l43_open_object 0.4.1 → 0.4.3
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 +4 -4
- data/lib/l43/open_object/version.rb +1 -1
- data/lib/l43/typed_object/description.rb +6 -2
- data/lib/l43/typed_object/implementation.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: 0e6b654d8ab9c0273bf651edcbc6f45b6f692ba14d538bbc92f0a75139363669
|
|
4
|
+
data.tar.gz: 5421472dcc47904bcdada7ce01702738741f9ed8bcaedf2b0ea787bcfc5b2548
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 49f2d64ce6a4c7ce3c7a166df5e571fc5eef7196c4ec37639fc31844ab9fd2579b117a366d69848aee95e6aa151a6534f8f78c69e91404f346ce01cdf41c8abe
|
|
7
|
+
data.tar.gz: 701136a1fdc933985eaf7ac2823b65d9cd0f4724eae7d4d52aa9d27b440f9a3bcb10acf7f5c53c7363fe5fe4f40f1549fca4f03190ef913ee2d861d5be068da0
|
|
@@ -11,10 +11,10 @@ module L43
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def implement =
|
|
14
|
-
Implementation.new(klass:, attributes: attributes.freeze, defaults:)
|
|
14
|
+
Implementation.new(klass:, attributes: attributes.freeze, defaults:, callable:)
|
|
15
15
|
|
|
16
16
|
private
|
|
17
|
-
attr_reader :allowed, :klass, :required
|
|
17
|
+
attr_reader :allowed, :callable, :klass, :required
|
|
18
18
|
def initialize(klass)
|
|
19
19
|
@klass = klass
|
|
20
20
|
end
|
|
@@ -35,6 +35,10 @@ module L43
|
|
|
35
35
|
end
|
|
36
36
|
end.freeze
|
|
37
37
|
end
|
|
38
|
+
|
|
39
|
+
def make_callable(&blk)
|
|
40
|
+
@callable = blk
|
|
41
|
+
end
|
|
38
42
|
end
|
|
39
43
|
end
|
|
40
44
|
end
|
|
@@ -8,10 +8,11 @@ module L43
|
|
|
8
8
|
class Implementation
|
|
9
9
|
|
|
10
10
|
private
|
|
11
|
-
attr_reader :attributes, :defaults, :klass
|
|
11
|
+
attr_reader :attributes, :callable, :defaults, :klass
|
|
12
12
|
|
|
13
|
-
def initialize(klass:, attributes:, defaults:)
|
|
13
|
+
def initialize(klass:, attributes:, defaults:, callable:)
|
|
14
14
|
@attributes = attributes
|
|
15
|
+
@callable = callable
|
|
15
16
|
@defaults = defaults
|
|
16
17
|
@klass = klass
|
|
17
18
|
implement
|
|
@@ -23,6 +24,12 @@ module L43
|
|
|
23
24
|
klass.send :include, Behavior
|
|
24
25
|
end
|
|
25
26
|
|
|
27
|
+
def define_call
|
|
28
|
+
return unless callable
|
|
29
|
+
|
|
30
|
+
klass.define_method :call, &callable
|
|
31
|
+
end
|
|
32
|
+
|
|
26
33
|
def define_initialize
|
|
27
34
|
allowed = self.allowed
|
|
28
35
|
attributes = self.attributes
|
|
@@ -38,6 +45,7 @@ module L43
|
|
|
38
45
|
args.each do |name, value|
|
|
39
46
|
instance_variable_set("@#{name}", value)
|
|
40
47
|
end
|
|
48
|
+
_init if respond_to?(:_init, private: true)
|
|
41
49
|
end
|
|
42
50
|
end
|
|
43
51
|
|
|
@@ -76,6 +84,7 @@ module L43
|
|
|
76
84
|
define_to_h
|
|
77
85
|
define_update
|
|
78
86
|
define_behavior
|
|
87
|
+
define_call
|
|
79
88
|
define_initialize
|
|
80
89
|
end
|
|
81
90
|
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: l43_open_object
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Robert Dober
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-11-
|
|
10
|
+
date: 2026-11-03 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: ostruct
|