module MyMod def MyMod.extend_object(obj) puts "Extending object id #{obj.id}, type #{obj.type}" super endendx = [1, 2, 3]x.extend(MyMod)# Output:# Extending object id 36491192, type Array