Use script call to identify map player is on

I have a common event which does player transfer things in a particular dungeon. That works fine. However, I want the event to do something slightly different if the player is on a particular map. Whereabouts the player is on that map is completely irrelevant, it is the map itself which is important.

Is there a script call I can use for a conditional branch?

Thanks
are you talking about the
$gameMap._mapId ? this give you the id from JSON (order map list, but break if you change order)
or also if you identify your map by name
$dataMap.displayName ?
or I may not be understood the question

PHP:
if($gameMap._mapId === myid){
 // do stuf
}

PHP:
if($dataMap.displayName === "dunjun2"){
 // do stuf
}

EDIT: sorry i not see you check for ruby code !
@Jonforum You gave me enough with the first option for me to translate it into Ruby, and it works.
So thank you!
Code:
class Game_Map
 def setup(map_id)
  super
  $map = self
 end
end

access from anywhere with $map.
no conditionals, nothing.
you can always drop the $map = self into the standard code itself, and it'll work the same
@Kes in a common event, you can use control variable : game data : map ID to load the map ID of the current map.
don't need a script - the interpreter keeps the id of the current map. So you can use either $game_map.map_id or simply @map.id (or it may need to be self.map_id)
So much simpler than I had thought. For some reason I'd got it into my head that the default map id option worked differently.

Thanks everyone for your help.

Moderator note: Closing
psst @Kes 😉
@Shaz not again!!!

Original thread: https://forums.rpgmakerweb.com/threads/use-script-call-to-identify-map-player-is-on.87872/