We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f328251 commit 57e5f36Copy full SHA for 57e5f36
lib/gon/watch.rb
@@ -2,13 +2,12 @@ class Gon
2
class Watch
3
class << self
4
5
- def method_missing(method, *args, &block)
6
- @return = return_variable?(method)
7
- Gon.send method, *args, &block
+ def all_variables
+ @watch_variables || {}
8
end
9
10
def clear
11
- @return = false
+ @watch_variables = {}
12
13
14
def need_return?
@@ -23,7 +22,15 @@ def return_variable(value)
23
22
24
private
25
+ def method_missing(method, *args, &block)
26
+ if return_variable?(method)
27
+ Gon.send method, *args, &block
28
+ end
29
30
+
31
def return_variable?(variable)
32
+ return false if variable !~ /=$/
33
34
controller = Gon::Base.get_controller
35
params = controller.params
36
variable = variable.to_s.gsub('=', '')
0 commit comments