add to_msgpack method to Ruby Core APIs.