Why I cannot set Copy.destinationDir property?

I cannot understand something in configuring tasks.
For example I create task
task myCopy(type: Copy) {
from(“myDir”) {
rename("$jarName", “$jarFinalName”)

because I see property destinationDir on this page

But I get an error saying

Could not find method destinationDir() for arguments [publish] on task ‘:prepareJar’ of type org.gradle.api.tasks.Copy.

If I change it to ‘into’ then all is well.
Why I have to use ‘into’ instead of property ‘destinationDir’ described in docs?

setDestinationDir requires a File object and you are passing a GString. It is better to use into as it takes an Object and allows for lazy-evaluation.

thanks for helping me