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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75e3e5174ef02170c0183d187bee29c7b77aa6e3
4
- data.tar.gz: f8823a6c370b47b5c5bb4c55f2436f6e6350cc65
3
+ metadata.gz: e8a6bd534e0b47cbf70e05f3a770eddbb1b53bdc
4
+ data.tar.gz: e76520e94fe00df151e178f4cf7e70e62b4c5504
5
5
  SHA512:
6
- metadata.gz: bf05be039df1174db007843da8dbca4647cc99b8f5db6b9f9e948f7951fac87c4491590326808cfedb43bbb67aff2de3c3f08c1c67c6198f2e03d9198feaefa8
7
- data.tar.gz: 49fbadfa283d4f2b47cc244f03eb2e0695ad732ce37f29cec2829627a75d7a8b2e95bd4203ded0d37bab35fa05f4a3991bbcb00671d1f1a492787d4f4b34e3c0
6
+ metadata.gz: 602b260b5e575d4efcffea7a1a2ac098cacc37ccf7ec02209315aab7f925191d8972b2ffab95cbd49310a2313f12dedcc447ec5340b4348693997a201ce449e1
7
+ data.tar.gz: 848f86e423e5a8a235d30e6a21679e57e74df5f35ddee2904e041868c11d7905ebd12b20e5e95df4018cba39aae3e6c3c90027abe8d6cc22cafd3595f47955fa
@@ -1,3 +1,3 @@
1
1
  module CallbacksAttachable
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
@@ -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
- self.class.__send__(*args) do |*args|
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.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: 2015-12-26 00:00:00.000000000 Z
11
+ date: 2016-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler