The general rule about aliases is "if you have to ask, use a function instead":
sin() {
rerun ruby "${PWD##*/}.rb"
}
which works as expected.
The particular problem in your case is that ${PWD##*/}
is expanded when you define the alias, and not when you run it. You could also fix it by using single quotes in the definition:
alias sin='rerun ruby "${PWD##*/}.rb"'