The X-Ray Luminosity Function and Gas Mass Function for Optically Selected Poor and Rich Clusters of Galaxies