This Ruby code will be executed when a train reaches the balise.
train is the reference to the train object and balise to the balise object.
Reference and examples