lib/motion/accessors.rb in rm-extensions-0.0.9 vs lib/motion/accessors.rb in rm-extensions-0.1.0
- old
+ new
@@ -2,13 +2,11 @@
module ObjectExtensions
module Accessors
- # creates an +attr_accessor+ like behavior, but the objects are stored with
- # a weak reference (OBJC_ASSOCIATION_ASSIGN). useful to avoid retain cycles
- # when you want to have access to an object in a place that isnt responsible
- # for that object's lifecycle.
+ # creates an +attr_accessor+ like behavior, but the objects are
+ # stored with a WeakRef.
# does not conform to KVO like attr_accessor does.
def rmext_weak_attr_accessor(*attrs)
attrs.each do |attr|
define_method(attr) do
instance_variable_get("@#{attr}")