render_turbo_stream 4.4.0 → 4.4.1

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: 2cfb040091b3e5fcee2eb48a126e707316ff2e88f56d5375cf491df3ec7008af
4
- data.tar.gz: 0deefe1b7acb1528606695a512eaa596fc6d31c4874807398484213e22eef7e0
3
+ metadata.gz: 2751555dcedccddcd194a704306282dd4a7f9e8dfce3da98fff1f3f43008826b
4
+ data.tar.gz: 40c7a231488efdd817a0143234188189e51c9dd27917c22858c637e7cce823ae
5
5
  SHA512:
6
- metadata.gz: c7c1f91debd98ecede2af7bdab72cebea1218d2a47f80c5eb2e27872f54b9c93668ab37ad34721836f8f65b65c6a8fe06a175e666aff3b60c870f3a0449b50a0
7
- data.tar.gz: 10e8f7ba4a595c97db9762747938e456e3c57df9bdaebcb44daa50f293c3f93bbfc5051f7739709577fb3281328d9f6c719481091fa66f3a769600be024ec35e
6
+ metadata.gz: 5c31b229cf1e1b14915c20e0a8b93ee5fe5f685fd3e1a2ae9b07d335d7b7a0b84a84b72138fa40e2ea71aa280f38cb66565ed3a3906e87d3d6f86b7ee0b58a15
7
+ data.tar.gz: a8fd505b93f9ebe97b1fcac9540bf4bd6bdc8181f05b4ba719dda2c38fb0984c4b2d8ece9b023e95f2ae218cca10db0838807679bada4a3820350abeac05bd94
@@ -1,43 +1,45 @@
1
- class Channel
2
-
3
- def initialize(channel, partial: nil, template: nil, target_id: nil, action: :replace)
4
- @channel = channel
5
- @partial = partial
6
- @template = template
7
- @target_id = target_id
8
- @action = action
9
- @test_responses = []
10
- end
11
-
12
- def target_id=(target_id)
13
- @target_id = target_id
14
- end
1
+ module RenderTurboStream
2
+ class Channel
3
+
4
+ def initialize(channel, partial: nil, template: nil, target_id: nil, action: :replace)
5
+ @channel = channel
6
+ @partial = partial
7
+ @template = template
8
+ @target_id = target_id
9
+ @action = action
10
+ @test_responses = []
11
+ end
12
+
13
+ def target_id=(target_id)
14
+ @target_id = target_id
15
+ end
16
+
17
+ def action=(action)
18
+ @action = action
19
+ end
20
+
21
+ def send(locals: {})
22
+ libs = RenderTurboStream::ChannelLibs.new
23
+ libs.render_to_channel(
24
+ @channel,
25
+ RenderTurboStream::Libs.target_id_to_target(@target_id),
26
+ @action,
27
+ template: @template,
28
+ partial: @partial,
29
+ locals: locals
30
+ )
31
+ @test_responses = libs.test_responses
32
+ end
33
+
34
+ def test_responses
35
+ @test_responses
36
+ end
37
+
38
+ private
39
+
40
+ def validate_params
41
+ raise 'Arguments partial and template cannot both be specified' if @partial && @template
42
+ end
15
43
 
16
- def action=(action)
17
- @action = action
18
44
  end
19
-
20
- def send(locals: {})
21
- libs = RenderTurboStream::ChannelLibs.new
22
- libs.render_to_channel(
23
- @channel,
24
- RenderTurboStream::Libs.target_id_to_target(@target_id),
25
- @action,
26
- template: @template,
27
- partial: @partial,
28
- locals: locals
29
- )
30
- @test_responses = libs.test_responses
31
- end
32
-
33
- def test_responses
34
- @test_responses
35
- end
36
-
37
- private
38
-
39
- def validate_params
40
- raise 'Arguments partial and template cannot both be specified' if @partial && @template
41
- end
42
-
43
45
  end
@@ -1,3 +1,3 @@
1
1
  module RenderTurboStream
2
- VERSION = "4.4.0"
2
+ VERSION = "4.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: render_turbo_stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.0
4
+ version: 4.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - christian