# Multiparadigm Programming with Python 3
# Rational Representation Module -- Interface
# Copyright (C) 2018, H. Conrad Cunningham
#
# 34567890123456789012345678901234567890123456789012345678901234567890
#
# 2018-10-19: Original Python version (referencing Haskell versions)
# 2018-11-01: Cleanup based on flake8, pylint, & black runs

from __future__ import annotations  # 3.7 deferred annotations
from abc import ABC, abstractmethod


class RatRep(ABC):
    """Abstract base class defining interface to representation"""

    @abstractmethod  # include only for mypy type checking
    def __init__(self, x: int, y: int) -> None:
        """Initialize rational number x/y"""
        pass

    # TODO: as class variable?
    @classmethod
    @abstractmethod
    def zeroRat(cls) -> RatRep:
        """Get canonical representation for zero"""
        pass

    @abstractmethod
    def numer(self) -> int:
        """Get numerator of rational number"""
        pass

    @abstractmethod
    def denom(self) -> int:
        """Get denominator of rational number"""
        pass
