input: Write a python function to count the number of words in a given text.
  assert WordCounter("This is some sample text.").count_words() == 5
  assert WordCounter("Another example with more words.").count_words() == 5
  assert WordCounter("SingleWord").count_words() == 1
output: class WordCounter:
      def __init__(self, text):
          self.text = text
      
      def count_words(self):
          return len(self.text.split())