Sha256: fdb2c5193b272c1b8611a6f01b408d9ce4ebbb1fbcff479a98e5f9d49488a85f

Contents?: true

Size: 465 Bytes

Versions: 4

Compression:

Stored size: 465 Bytes

Contents

class Array

  def to_pointer(type)
    ret = Pointer.new(type, self.length)
    self.each_index do |i|
      ret[i] = self[i]
    end
    ret
  end

  def uiindexpath
    if self.length == 0
      raise "An index path must have at least one index"
    end

    path = nil
    self.each do |val|
      if path
        path = path.indexPathByAddingIndex(val)
      else
        path = NSIndexPath.indexPathWithIndex(val)
      end
    end
    return path
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sugarcube-0.7.7 lib/sugarcube/array.rb
sugarcube-0.7.6 lib/sugarcube/array.rb
sugarcube-0.7.4 lib/sugarcube/array.rb
sugarcube-0.7.3 lib/sugarcube/array.rb