websocketable 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11ec4b22db751f1553b06022e8940d650e790ebec57b42b3a8332877d22714bd
4
- data.tar.gz: f18011eb2a91b0ac44226e3ba0de376a47e0bbd6bc72bca60f224da6fad25996
3
+ metadata.gz: c2af89500391e7ebc351cf82252baa67fd9509e07d0668401715199fa5268865
4
+ data.tar.gz: d7c231918f5428ae5a54f427ac7cd4a8210487b89098615f49e787a263764409
5
5
  SHA512:
6
- metadata.gz: 4dcc70bf13af85be09be51a4fdfcec9b1ec5b692e45510a1e1f9c8ea1e0b806bd5b1c29d59b3f669458478c2864f35feb069482c718e4f762fefa7f73daf8496
7
- data.tar.gz: 2b2e9cc5d797b5a1f3b55ba79cad55578009624f2764b8f64c516c843563553c3f74813348b05942e1dde872ab6dd09bd575c36ec25396b9a2d11a53725041de
6
+ metadata.gz: a6b27d0e616cc47403422db1b6a62a455785f14ad076cf34e727cff7875c8148af563edb4a18693baf6a4cb45ba3ef2038b14cb0a8a4f54f32e3c6d313f12b9a
7
+ data.tar.gz: 2eab34409ec6c37ff65ea6ef262c745e3deb07f7122c80775de666734220e1717a8d6eb182cb350c6170003329fe339fd5d90f8b36126b5317e4591c3cd5dbc3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- websocketable (0.0.1)
4
+ websocketable (0.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -0,0 +1,23 @@
1
+ module Websocketable
2
+ module Blueprinter
3
+ module Helper
4
+
5
+ def broadcast_for_channel(channel, blueprint, resource)
6
+ ActionCable.server.broadcast channel, hashable(blueprint, resource)
7
+ head :ok
8
+ end
9
+
10
+ def broadcast_to_channel(channel, resource)
11
+ channel.broadcast_to resource, hashable(blueprint, resource)
12
+ head :ok
13
+ end
14
+
15
+ private
16
+
17
+ def hashable(blueprint, resource)
18
+ blueprint.render_as_hash(resource)
19
+ end
20
+
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module Websocketable
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: websocketable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Heft
@@ -56,6 +56,7 @@ files:
56
56
  - lib/generators/templates/initializer.rb
57
57
  - lib/generators/websocketable/install_generator.rb
58
58
  - lib/websocketable.rb
59
+ - lib/websocketable/blueprinter/helper.rb
59
60
  - lib/websocketable/configuration.rb
60
61
  - lib/websocketable/version.rb
61
62
  - websocketable.gemspec