Bushido (, "the way of warriors") is a Japanese collective term for the many codes of honour and ideals that dictated the samurai way of life, loosely analogous to the concept of chivalry in Europe.

Answer this question based on the passage: which class in japanese society followed the code of bushido? Let's have some stream of consciousness first.
To answer the above question, the relevant sentence is: Bushido (, "the way of warriors") is a Japanese collective term for the many codes of honour and ideals that dictated the samurai way of life, loosely analogous to the concept of chivalry in Europe. So, the answer is the samurai.