Sha256: 5c9534cfc4b040c656dc9b8f88063f5cf3c612576e4c67efd5d5b0f9863ef228

Contents?: true

Size: 653 Bytes

Versions: 31

Compression:

Stored size: 653 Bytes

Contents

class SKNode

  def <<(node)
    addChild(node)
  end

  def run_action(action, &completion)
    runAction(action, completion: completion)
  end

  def [](key)
    self.userData ||= {}
    userData[key.to_s]
  end

  def []=(key, value)
    self.userData ||= {}
    userData[key.to_s] = value
  end

  def each_named(name, &block)
    if block.arity == 1
      using_block = -> (node, stop_ptr) { block.call(node) }
    else
      using_block = block
    end
    enumerateChildNodesWithName(name, usingBlock: using_block)
  end

  def to_s
    "#<#{self.class}:0x#{self.object_id.to_s(16)} position=#{position.inspect} name=#{name.inspect}>"
  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
sugarcube-4.0.0 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.5.0 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.4.2 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.4.1 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.4.0 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.3.7 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.3.6 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.3.5 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.3.4 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.3.3 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.3.2 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.3.1 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.3.0 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.2.0 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.1.1 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.1.0 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.0.8 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.0.7 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.0.6 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.0.5 lib/cocoa/sugarcube-spritekit/sknode.rb