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-3.0.4 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.0.3 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.0.2 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.0.1 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-3.0.0 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-2.12.3 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-2.12.2 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-2.12.1 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-2.12.0 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-2.11.1 lib/cocoa/sugarcube-spritekit/sknode.rb
sugarcube-2.11.0 lib/cocoa/sugarcube-spritekit/sknode.rb