birdel 3.2.0 → 3.3.0

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: e7f141c3d5be51f76b78a748d5521d24a7f1921e2eb0a6167490c4706a3dd925
4
- data.tar.gz: 510744019aa67d13ced99d9ead12b65e415412c5e19065b68bdb52442e0e9cda
3
+ metadata.gz: d9680819adeaf987cde13c73e5671b5255f89dfbcd0f5a0079b274c3f190b3fa
4
+ data.tar.gz: 18759e84b3cd4fee0d17915a2a146a57038163ae88b743103b47a85d52dd6dec
5
5
  SHA512:
6
- metadata.gz: 45de59d0371824a3d04928e9b29a11c58aeb194389178ec70e7f2baf4d124d8a8f2cb63b928e56d72e6755f723b5b160ad74607a60fe3510966891fcf2e6bbf2
7
- data.tar.gz: f17fd2d63c274875b715ebb1cd0c937d2f17f7190fa31771dbc0b2723a5ac79aeb739f4acfdde073aa9953fbd878ea6fae9a3844f2bbbea357c34c9e34ee3c4f
6
+ metadata.gz: e505336ed3c3b22a2433dd04705692a7ec0e8e7a987ef00a2fb8a168c76ba33a1be007bb7f5ee66f4d7d1a07890c63011c8a43fa1563000ccc331b83be44871d
7
+ data.tar.gz: a1166e30b54bddac9560c2540cdfc662901d9e728de02012938b52085173d4a28a1a64d478a3a1cfb137194092a6364d026fe680c87bdf1e15f820b274ef40fc
@@ -4,26 +4,26 @@ module Birdel
4
4
  def actorThrough(data)
5
5
  actor_name = data.fetch("actor")
6
6
  inputs = data.fetch("inputs")
7
- callback = data.fetch("callback")
7
+ callback = data.fetch("callback", false)
8
8
  required_component = data.fetch("required_component")
9
9
  method = data.fetch("method")
10
10
 
11
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)
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
15
  res = {
16
- "ok": method_res[:ok],
17
- "message": method_res[:message],
16
+ "ok": method_res[:ok],
17
+ "message": method_res[:message],
18
18
  "data": {
19
- "actor": actor_name,
20
- "method": method,
19
+ "actor": actor_name,
20
+ "method": method,
21
21
  "outputs": method_res[:outputs]
22
22
  }
23
23
  }
24
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])
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
27
  res[:data][:html] = ApplicationController.render(component, layout: false)
28
28
  end
29
29
  if callback
@@ -33,7 +33,7 @@ module Birdel
33
33
  if method_res[:resource_id].present?
34
34
  res[:callback][:resourceId] = method_res[:resource_id]
35
35
  else
36
- res[:callback][:resourceId] = callback[:resourceId].present? ? callback[:resourceId] : false
36
+ res[:callback][:resourceId] = callback["resourceId"].present? ? callback["resourceId"] : false
37
37
  end
38
38
  ActionCable.server.broadcast(self.first_stream, res)
39
39
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Birdel
4
- VERSION = "3.2.0"
4
+ VERSION = "3.3.0"
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: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serhii