rm-extensions 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/motion/accessors.rb +15 -14
- data/lib/rm-extensions/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: 84dc10ae9942e20efb063bfbab3f7fb0a1651524
|
4
|
+
data.tar.gz: ef538c09c7a85d1c36544c2336c8e2da9003353b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2df9a9c76852ed1adb84fe1e8a28f45746493f7e7a3113ae512e44cc024e1242f3225ec7d7193f028639dd577fe70d60d67c9320c68b6162156f3a4f43c42d29
|
7
|
+
data.tar.gz: b0db0adf1a9c91242ea1333a51183ebc397c4d1320b8b735fd6d3ea04a789ab1a6f4792ebc91b1c4a56512f20c3f9b62a19f8929bf9f55166e97bae05d4c4b92
|
data/lib/motion/accessors.rb
CHANGED
@@ -4,20 +4,20 @@ module RMExtensions
|
|
4
4
|
|
5
5
|
module Accessors
|
6
6
|
|
7
|
-
# creates an +attr_accessor+ like behavior, but the objects are
|
8
|
-
# stored with a WeakRef.
|
9
|
-
# does not conform to KVO like attr_accessor does.
|
10
|
-
def rmext_weak_attr_accessor(*attrs)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
end
|
7
|
+
# # creates an +attr_accessor+ like behavior, but the objects are
|
8
|
+
# # stored with a WeakRef.
|
9
|
+
# # does not conform to KVO like attr_accessor does.
|
10
|
+
# def rmext_weak_attr_accessor(*attrs)
|
11
|
+
# attrs.each do |attr|
|
12
|
+
# define_method(attr) do
|
13
|
+
# instance_variable_get("@#{attr}")
|
14
|
+
# end
|
15
|
+
# define_method("#{attr}=") do |val|
|
16
|
+
# instance_variable_set("@#{attr}", val.nil? ? nil : WeakRef.new(val))
|
17
|
+
# val
|
18
|
+
# end
|
19
|
+
# end
|
20
|
+
# end
|
21
21
|
|
22
22
|
# creates an +attr_accessor+ like behavior, but the objects are
|
23
23
|
# stored in an NSMapTable with strong keys (the attrs) and
|
@@ -38,6 +38,7 @@ module RMExtensions
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
41
|
+
alias_method :rmext_weak_attr_accessor, :rmext_zeroing_weak_attr_accessor
|
41
42
|
|
42
43
|
end
|
43
44
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rm-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Noon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Extensions and helpers for dealing with various areas of rubymotion
|
14
14
|
email:
|