stimulus_reflex 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of stimulus_reflex might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/stimulus_reflex/channel.rb +1 -1
- data/lib/stimulus_reflex/controller.rb +7 -0
- data/lib/stimulus_reflex/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df68c360175088bb48c2916ea3b5af8139644cf88a276a16ae89ee037321f136
|
4
|
+
data.tar.gz: 25e23102624eeb2a31afffab458a788dc36dad4dff5d94b0a51ba8037be559d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 386aafa2f5169f2534d42c7f00964ccc50573d4cacb402bc5eb907982b45044260286b8d9cc2f86f2183eb505e3dd51b5a06bcb6b8b1c4ae499501aa1de6ffa8
|
7
|
+
data.tar.gz: 39d8f54028f062e2fa06bb317b7ff908ea0aa9d316cdca93ca08ca7a5ecd7729466f91825fbdb5d68d97df64288b3fb6d020ee17d1fe6cadc2e4c4e65208a8eb
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![Lines of Code](http://img.shields.io/badge/lines_of_code-
|
1
|
+
[![Lines of Code](http://img.shields.io/badge/lines_of_code-136-brightgreen.svg?style=flat)](http://blog.codinghorror.com/the-best-code-is-no-code-at-all/)
|
2
2
|
[![Maintainability](https://img.shields.io/codeclimate/maintainability/hopsoft/stimulus_reflex.svg)](https://codeclimate.com/github/hopsoft/stimulus_reflex)
|
3
3
|
|
4
4
|
# StimulusReflex
|
@@ -41,7 +41,7 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
|
|
41
41
|
private
|
42
42
|
|
43
43
|
def delegate_call_to_stimulus_controller(stimulus_controller, method_name, arguments = [])
|
44
|
-
instrument_payload = {
|
44
|
+
instrument_payload = {stimulus_controller: stimulus_controller.class.name, method_name: method_name, arguments: arguments.inspect}
|
45
45
|
ActiveSupport::Notifications.instrument "delegate_call.stimulus_reflex", instrument_payload do
|
46
46
|
if stimulus_controller.method(method_name).arity > 0
|
47
47
|
stimulus_controller.send method_name, *arguments
|
@@ -1,7 +1,14 @@
|
|
1
1
|
class StimulusReflex::Controller
|
2
2
|
attr_reader :channel
|
3
3
|
|
4
|
+
delegate :connection, to: :channel
|
5
|
+
delegate :session, to: :request
|
6
|
+
|
4
7
|
def initialize(channel)
|
5
8
|
@channel = channel
|
6
9
|
end
|
10
|
+
|
11
|
+
def request
|
12
|
+
@request ||= ActionDispatch::Request.new(connection.env)
|
13
|
+
end
|
7
14
|
end
|