opal-phoenix 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
  SHA1:
3
- metadata.gz: f85d9f0bcb2d8390686f6ed2918580c4587d73b8
4
- data.tar.gz: 760241e4c58d0e9135461552cd6a906c73e68acf
3
+ metadata.gz: 14182af3573c1c320f20812eeb4218b3992dce76
4
+ data.tar.gz: 0392ca37fb6c10f395207260aa4cd8298147b5c3
5
5
  SHA512:
6
- metadata.gz: 08712e7e51267ee6ea4fc859fa34abafdc68b5758cdf909fec9020621a057fe79de26be4259962f89cd56dbbe1b3ff9019968d9c1ce7300a9961ff9d69cf92a2
7
- data.tar.gz: 6bc25318b78b75e37fce070d2aae805d4186ccef0f540f8b46740f539ccadd0839d78b2edbdfaa8a6e2940a054fe106a2e7ab337a41d9d0a6ebd212d20860525
6
+ metadata.gz: 059793cded3808cdccfc672ef41ee1fc7e1a2fedb40722e381a73e9b3bcfd8cf18cc6fe8be0f4e687821a79ac2c245d13edf247fbf7aeb6c92662b915187d16c
7
+ data.tar.gz: f7a28a3cb85d4d25cc98a107bf1c414bdc6cdce08106990a6f00d525157eee1e8654aa2174108da6ec511d98f24518e8db05743c8364edb09997b0928d660fe1
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'opal-phoenix'
3
- s.version = '0.0.2'
3
+ s.version = '0.0.3'
4
4
  s.authors = ['Michał Kalbarczyk']
5
5
  s.email = 'fazibear@gmail.com'
6
6
  s.homepage = 'http://github.com/fazibear/opal-phoenix'
@@ -7,7 +7,7 @@ module Phoenix
7
7
  end
8
8
 
9
9
  def on(msg, &block)
10
- `#{@native}.on(#{msg}, #{block})`
10
+ `#{@native}.on(#{msg}, #{callback(block)})`
11
11
  end
12
12
 
13
13
  def push(msg, payload)
@@ -27,11 +27,17 @@ module Phoenix
27
27
  end
28
28
 
29
29
  def on_error(&block)
30
- `#{@native}.onError(#{block})`
30
+ `#{@native}.onError(#{callback(block)})`
31
31
  end
32
32
 
33
33
  def on_close(&block)
34
- `#{@native}.onClose(#{block})`
34
+ `#{@native}.onClose(#{callback(block)})`
35
+ end
36
+
37
+ def callback(block)
38
+ proc do |e|
39
+ block.call(Native(e))
40
+ end
35
41
  end
36
42
  end
37
43
  end
@@ -7,7 +7,13 @@ module Phoenix
7
7
  end
8
8
 
9
9
  def receive(msg, &block)
10
- Push.new `#{@native}.receive(#{msg}, #{block})`
10
+ Push.new `#{@native}.receive(#{msg}, #{callback(block)})`
11
+ end
12
+
13
+ def callback(block)
14
+ proc do |e|
15
+ block.call(Native(e))
16
+ end
11
17
  end
12
18
  end
13
19
  end
@@ -15,11 +15,17 @@ module Phoenix
15
15
  end
16
16
 
17
17
  def on_error(&block)
18
- `#{@native}.onError(#{block})`
18
+ `#{@native}.onError(#{callback(block)})`
19
19
  end
20
20
 
21
21
  def on_close(&block)
22
- `#{@native}.onClose(#{block})`
22
+ `#{@native}.onClose(#{callback(block)})`
23
+ end
24
+
25
+ def callback(block)
26
+ proc do |e|
27
+ block.call(Native(e))
28
+ end
23
29
  end
24
30
  end
25
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-phoenix
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
  - Michał Kalbarczyk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-18 00:00:00.000000000 Z
11
+ date: 2015-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal