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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd600c99b81640a4f19345bb5fc2699449d18553
4
- data.tar.gz: 97968a4541609b339a6fb840a69fd35a0ba1cc9c
3
+ metadata.gz: d760b055f2a6dca80d03f71a2ab1ac64ae136e46
4
+ data.tar.gz: 56240570bea8667aa0e539362d50b26553da5db0
5
5
  SHA512:
6
- metadata.gz: cc8771acac90d02ea3fbea7dec517746d64f79865c6b7ba09165dde484ec73c134b6047fa725f5fa0c04bce18bc7561455b25571bb2a830ce517859ad37c9cda
7
- data.tar.gz: 89dfb2ded39f4bec57136f221883d35c5e9f39e50f08a14432b9db9f6e98950e4eea32b3137b77402b40b801fcd4bfec611deacbbd3e5a18162da762a9b5e1cc
6
+ metadata.gz: 41360349dc159a7d3b37685ad102d49c90923d00e913276255fe644b25db32e3d13dfa0b35ab5af03029d4a57a085dd3e04e83bd46cfc2fc8a2170998a2fb107
7
+ data.tar.gz: 52dcfd7ceadc96185c90d81b6ac7a23441f6ee0cd9d9645354fe55dc26d01f642a30c6d03847a87d08068a23bf6c81febba4c167fae190cac0e91b17db0e08f1
@@ -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.is_a?(t.model) && t.callback == callback }
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
@@ -1,3 +1,3 @@
1
1
  module Triggerable
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
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.5
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-14 00:00:00.000000000 Z
11
+ date: 2014-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler