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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc3a1e861edd130625410ba1ab8a051a35f8f7072bd6b586df93f76d17305d25
4
- data.tar.gz: 18fffba9daeb136d2ad29ecb9dbb0c4db474a975592104f698559307bb893edb
3
+ metadata.gz: faab7b02dd01e572eaae3a25c2033282844cfe425546876c02ac6ba77905b522
4
+ data.tar.gz: 54d4574fdcf44058042882d143db6b9cdd8630da9ce7c99d6676642b43805c2c
5
5
  SHA512:
6
- metadata.gz: 3ebc81284fc5d986b1e16454196f563ee1c16ec6ddb6f620a972399f692ade26c5e9bc27a6cfe177975136d946f4b81f28a17a400514ead75bf4e16fc11ab0a9
7
- data.tar.gz: 2d70c74bdb3072733a2e146acc7c2e422e472e782a2bdb5053e3f13346dc28ffbdabdaa350e717ec221d92cf7c953c0525447faca17e86eab2cc65eeb511bec1
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
- class RonaActor
5
- class << self
6
- def actorDirect(data)
7
- actor_name = data.fetch("actor")
8
- inputs = data.fetch("inputs")
9
- callback = data.fetch("callback")
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
- actor_string = actor_name.split("__").map{|e| e.camelize}.join("::")
14
- res_name = actor_string << "::#{actor_string.split("::")[-1]}"
15
- actor = res_name.constantize.new()
16
- method_res = actor.public_send(method, inputs, self.current_user)
17
- res = {
18
- "ok": method_res[:ok],
19
- "message": method_res[:message],
20
- "data": {
21
- "actor": actor_name,
22
- "method": method,
23
- "outputs": method_res[:outputs]
24
- }
25
- }
26
- if required_component
27
- component_name = required_component.split('--').map{|i| i.gsub("-", "_").camelize}.join('::') + '::' + required_component.split('--').last.gsub("-", "_").camelize
28
- component = component_name.constantize.new(inputs: method_res[:outputs])
29
- res[:data][:html] = ApplicationController.render(component, layout: false)
30
- end
31
- if callback
32
- res[:callback] = callback
33
- res[:callback][:resourceId] = method_res[:resource_id] if method_res[:resource_id]
34
- ActionCable.server.broadcast(self.first_stream, res)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Birdel
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: birdel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serhii