Implement basic gate class.