callbacks_attachable 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/callbacks_attachable/version.rb +1 -1
- data/lib/callbacks_attachable.rb +4 -2
- 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: e8a6bd534e0b47cbf70e05f3a770eddbb1b53bdc
|
4
|
+
data.tar.gz: e76520e94fe00df151e178f4cf7e70e62b4c5504
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 602b260b5e575d4efcffea7a1a2ac098cacc37ccf7ec02209315aab7f925191d8972b2ffab95cbd49310a2313f12dedcc447ec5340b4348693997a201ce449e1
|
7
|
+
data.tar.gz: 848f86e423e5a8a235d30e6a21679e57e74df5f35ddee2904e041868c11d7905ebd12b20e5e95df4018cba39aae3e6c3c90027abe8d6cc22cafd3595f47955fa
|
data/lib/callbacks_attachable.rb
CHANGED
@@ -83,10 +83,12 @@ module CallbacksAttachable
|
|
83
83
|
|
84
84
|
private
|
85
85
|
|
86
|
-
def if_self(*args, &block)
|
86
|
+
def if_self(*args, skip: 0, &block)
|
87
87
|
instance = self
|
88
|
-
|
88
|
+
count = 0
|
89
|
+
self.class.__send__(*args, skip: 0) do |*args|
|
89
90
|
next if instance != self
|
91
|
+
next unless (count += 1) > skip
|
90
92
|
block.call(*args)
|
91
93
|
end
|
92
94
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: callbacks_attachable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Aue
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|