birdel 3.0.1 → 3.1.1

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: 40599925aad88f556556c06495eb89752d71a8865a71debbb1347bbc34890a1b
4
- data.tar.gz: c7365b76eaa804f685b01e96b40348620c07e3fbaacad38d34a6333b968fd438
3
+ metadata.gz: 0d8dc0e1d0da67142ec9296c5e70777e05d9f8b87d28d6b21756b936b4cc1a84
4
+ data.tar.gz: d77fbe9c10748d5e0bc2fe9b2742c4d28850284547d5ba7fbe0c9a625e8dffb8
5
5
  SHA512:
6
- metadata.gz: 9422f02523f26ab5273fbb0b120280d3c0ebdf0ae952bf9d159237b964220dd2e1d3203582a7000a1be377f6aaffb4d97d539e8cd64f98bb83b7e87f5e783dc7
7
- data.tar.gz: d11f384d3fd2858294e609cce4399f950be2acce572a71ec74b0891cb10ac69d3362788ac88466f61603616f5fdb9cf820632119b0c7858aa8e463ef886621a4
6
+ metadata.gz: 4ee6adc2be2799c44781375f11a3eecc1aa47624950a1fff35c6b18e3bb07f5ab4bea04d374e3fe35549f13655979393d9fa19a5e4951f75d5d968cd63aba9fe
7
+ data.tar.gz: 32e59e1b6d4e11e8ca800c0cf29f7185bb35c401a1e2240dfc86ac09f35f278789b9dd230a9506335659ca5833f661795df5b119cb792b2fa345c3afb4d26327
@@ -28,28 +28,15 @@ module Birdel
28
28
  end
29
29
  if callback
30
30
  res[:callback] = callback
31
- res[:callback][:resourceId] = method_res[:resource_id] if method_res[:resource_id]
31
+ # first - check if Actor method returned specific resource_id
32
+ # otherwise - set resource_id from callback if it exists or set false
33
+ if method_res[:resource_id].present?
34
+ res[:callback][:resourceId] = method_res[:resource_id]
35
+ else
36
+ res[:callback][:resourceId] = callback[:resource_id].present? ? callback[:resource_id] : false
37
+ end
32
38
  ActionCable.server.broadcast(self.first_stream, res)
33
39
  end
34
40
  end
35
-
36
- def actorDirect(data)
37
- inputs = data.fetch("inputs")
38
- callback = data.fetch("callback")
39
- required_component = data.fetch("required_component")
40
- component_name = required_component.split('--').map{|i| i.gsub("-", "_").camelize}.join('::') + '::' + required_component.split('--').last.gsub("-", "_").camelize
41
- component = component_name.constantize.new(inputs: inputs)
42
- res = {
43
- "ok": true,
44
- "message": "Actor Direct",
45
- "data": {
46
- "outputs": inputs,
47
- "html": ApplicationController.render(component, layout: false)
48
- }
49
- }
50
- res[:callback] = callback
51
- res[:callback][:resourceId] = callback[:resource_id]
52
- ActionCable.server.broadcast(self.first_stream, res)
53
- end
54
41
  end
55
42
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Birdel
4
- VERSION = "3.0.1"
4
+ VERSION = "3.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: birdel
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serhii
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-04 00:00:00.000000000 Z
11
+ date: 2023-06-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Send json messages to your actors and get view_components back! Now you
14
14
  can be sure that your actors are processed correctly.