This works, but from a design point of view, i would put this information with the disaster, such that it can be accessed here via message.disaster_class.rescue_building. Then you can arbitrarily add disaster in the future and this code will automatically work.