Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.
Chances are that the core functionality of Tilemap are not scripted in Ruby.
If it is not scripted in Ruby then you probably won't be able to retrieve the code through legal means
The following is an attempt I made to reproduce the Tilemap class in RGSS 2. Please note that it's not complete and certain features,
such as wall shadows, are not supported. The link is below.