Sha256: 7595b2ba5463386891655b442c0c4b4fe8b31881547994bbc323855a97af03a4

Contents?: true

Size: 516 Bytes

Versions: 6

Compression:

Stored size: 516 Bytes

Contents

class Kernel
  def pp(*attrs)
    NSLog([*attrs].map(&:inspect).join(' '))
  end

  def class_name_without_kvo
    self.class.name.gsub(/^NSKVONotifying_/, '')
  end

  def weak_ref
    WeakRef.new(self)
  end

  def strong_ref
    self
  end

  def clear_instance_variables(options = {})
    ivars = self.instance_variables
    clear_block = proc { |ivar|
      next if Array.wrap(options[:except]).include?(ivar[1..-1])
      self.instance_variable_set(ivar, nil)
    }.weak!
    ivars.each(&clear_block)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
motion-prime-0.6.0 motion-prime/core_ext/kernel.rb
motion-prime-0.5.7 motion-prime/core_ext/kernel.rb
motion-prime-0.5.6 motion-prime/core_ext/kernel.rb
motion-prime-0.5.5 motion-prime/core_ext/kernel.rb
motion-prime-0.5.4 motion-prime/core_ext/kernel.rb
motion-prime-0.5.3 motion-prime/core_ext/kernel.rb