First of all, if you are an observer in an inertial reference frame then you are perfectly justified in assuming that you are stationary and nothing needs to be explained to you.
Your question is how an outside observer, who thinks that you are moving, can rationalize that you measure both light pulses at the same speed of c while using one ruler. You are overlooking the relativity of simultaneity. You should consider this as an outside observer would. The outside observer thinks that your clocks are set wrong. He thinks that your clock at the leading end of the ruler is set behind when compared with your clock at the trailing end of the ruler. When you time the light pulse coming at you from the front, the light pulse passes the leading end clock first and later passes the trailing clock. But the leading end clock was set behind, so you calculate a slower relative light speed than you should. On the other hand, when you time the light pulse coming at you from the rear, the light pulse passes the trailing end clock first and later passes the leading clock. But the leading end clock was set behind, so you calculate a faster relative light speed than you should. In both light pulses, you calculate relative speeds of exactly c. So an outside observer understands that you can use one ruler to get a speed of c for both light pulses because you use clocks that he thinks are set wrong.