triggerable 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/triggerable/engine.rb +3 -3
- data/lib/triggerable/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d760b055f2a6dca80d03f71a2ab1ac64ae136e46
|
4
|
+
data.tar.gz: 56240570bea8667aa0e539362d50b26553da5db0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41360349dc159a7d3b37685ad102d49c90923d00e913276255fe644b25db32e3d13dfa0b35ab5af03029d4a57a085dd3e04e83bd46cfc2fc8a2170998a2fb107
|
7
|
+
data.tar.gz: 52dcfd7ceadc96185c90d81b6ac7a23441f6ee0cd9d9645354fe55dc26d01f642a30c6d03847a87d08068a23bf6c81febba4c167fae190cac0e91b17db0e08f1
|
data/lib/triggerable/engine.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class Engine
|
2
2
|
cattr_accessor :triggers, :automations, :interval
|
3
3
|
|
4
|
-
self.triggers
|
4
|
+
self.triggers = []
|
5
5
|
self.automations = []
|
6
6
|
|
7
7
|
def self.trigger model, options, block
|
@@ -13,7 +13,7 @@ class Engine
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.triggers_for obj, callback
|
16
|
-
triggers.select{|t| obj.
|
16
|
+
triggers.select { |t| obj.class.name == t.model.name && t.callback == callback }
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.run_automations interval
|
@@ -22,7 +22,7 @@ class Engine
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.clear
|
25
|
-
self.triggers
|
25
|
+
self.triggers = []
|
26
26
|
self.automations = []
|
27
27
|
end
|
28
28
|
end
|
data/lib/triggerable/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: triggerable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DmitryTsepelev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|