birdel 0.3.1 → 0.3.2
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/birdel/rona/rona_actor.rb +28 -36
- data/lib/birdel/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faab7b02dd01e572eaae3a25c2033282844cfe425546876c02ac6ba77905b522
|
4
|
+
data.tar.gz: 54d4574fdcf44058042882d143db6b9cdd8630da9ce7c99d6676642b43805c2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd4b50c56c31c5573021c7003b22fa765798742259d170d69072ae1d2353796d093efc3616810c18a6084b96d18a68e82603df4468c3ff7edcf63766d29da48c
|
7
|
+
data.tar.gz: 5c42e187572d125b2c2044f9f7fc41f43b53bc60ce8920806ef14be76fa9c651c7cb153d466941c11e9d21898f6508f6e8de5f1cb05ad10b821ee4902e78e186
|
@@ -1,44 +1,36 @@
|
|
1
1
|
# Routing Overlay Network Actor
|
2
2
|
module Birdel
|
3
3
|
module Rona
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
required_component = data.fetch("required_component")
|
11
|
-
method = data.fetch("method")
|
4
|
+
def actorDirect(data)
|
5
|
+
actor_name = data.fetch("actor")
|
6
|
+
inputs = data.fetch("inputs")
|
7
|
+
callback = data.fetch("callback")
|
8
|
+
required_component = data.fetch("required_component")
|
9
|
+
method = data.fetch("method")
|
12
10
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
end
|
36
|
-
end
|
11
|
+
actor_string = actor_name.split("__").map{|e| e.camelize}.join("::")
|
12
|
+
res_name = actor_string << "::#{actor_string.split("::")[-1]}"
|
13
|
+
actor = res_name.constantize.new()
|
14
|
+
method_res = actor.public_send(method, inputs, self.current_user)
|
15
|
+
res = {
|
16
|
+
"ok": method_res[:ok],
|
17
|
+
"message": method_res[:message],
|
18
|
+
"data": {
|
19
|
+
"actor": actor_name,
|
20
|
+
"method": method,
|
21
|
+
"outputs": method_res[:outputs]
|
22
|
+
}
|
23
|
+
}
|
24
|
+
if required_component
|
25
|
+
component_name = required_component.split('--').map{|i| i.gsub("-", "_").camelize}.join('::') + '::' + required_component.split('--').last.gsub("-", "_").camelize
|
26
|
+
component = component_name.constantize.new(inputs: method_res[:outputs])
|
27
|
+
res[:data][:html] = ApplicationController.render(component, layout: false)
|
28
|
+
end
|
29
|
+
if callback
|
30
|
+
res[:callback] = callback
|
31
|
+
res[:callback][:resourceId] = method_res[:resource_id] if method_res[:resource_id]
|
32
|
+
ActionCable.server.broadcast(self.first_stream, res)
|
37
33
|
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def actorDirect(data)
|
41
|
-
RonaActor.actorDirect(data)
|
42
34
|
end
|
43
35
|
end
|
44
36
|
end
|
data/lib/birdel/version.rb
CHANGED