5 # Create an animal and zoo
6 tiger1 = Example::Animal.new("tiger1")
9 # At the animal to the zoo - this will transfer ownership
10 # of the underlying C++ object to the C++ zoo object
11 zoo.add_animal(tiger1)
13 # get the id of the tiger
14 id1 = tiger1.object_id
23 # Get the tiger and its id
24 tiger2 = zoo.get_animal(0)
25 id2 = tiger2.object_id
27 # The ids should not be the same
29 raise RuntimeError, "Id's should not be the same"
37 # This method is no longer valid since the zoo freed the underlying
42 rescue ObjectPreviouslyDeleted => error
46 raise(RuntimeError, "Incorrect exception raised - should be ObjectPreviouslyDeleted") unless ok