Sha256: ec25eff06b848aa3ec99bc8ac3af07c712707bf23ea1e5ce8199f80395b0ba0a
Contents?: true
Size: 859 Bytes
Versions: 74
Compression:
Stored size: 859 Bytes
Contents
class NSArray # Creates an NSIndexPath object using the items in `self` as the indices # @return [NSIndexPath] def nsindexpath 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 # Creates an NSIndexSet object using the items in `self` as the indices # @return [NSIndexSet] def nsindexset if self.length == 0 raise "An index set must have at least one index" end set = NSMutableIndexSet.indexSet self.each do |val| set.addIndex val end set end def nsset NSSet.setWithArray self end def nsorderedset NSOrderedSet.orderedSetWithArray self end end
Version data entries
74 entries across 74 versions & 1 rubygems