When a public offense is committed in the presence of a magistrate, the magistrate may, by verbal or written order, command any person to arrest the offender, and then proceed as if the offender had been brought before the magistrate on a warrant of arrest.