How to activate Webcam using Python object oriented programming?

I tried performing a python code in object oriented programming using one Camera Class for activating webcam without using def main(). I failed to perform this steps. Kindly help me with the answer.

     import cv2
     class Camera:
     def __init__(self):
        self.cap = cv2.VideoCapture(0)
        self.stop = False

     def take_frame (self):
        while (self.stop == False):
            self.frame =

     def get_current_frame (self):
        return self.frame

     def check_connection (self):
        if cv2.waitKey(10) & 0xFF == ord('q'):
            self.stop = True

if __name__== '__main__':
    webcam = Camera()