class CFPropertyList::Binary

def count_object_refs(object)

def count_object_refs(object)
  case object
  when CFArray
    contained_refs = 0
    object.value.each do |element|
      if CFArray === element || CFDictionary === element
        contained_refs += count_object_refs(element)
      end
    end
    return object.value.size + contained_refs
  when CFDictionary
    contained_refs = 0
    object.value.each_value do |value|
      if CFArray === value || CFDictionary === value
        contained_refs += count_object_refs(value)
      end
    end
    return object.value.keys.size * 2 + contained_refs
  else
    return 0
  end
end