24 lines
528 B
Python
24 lines
528 B
Python
|
# -*- coding: utf-8 -*-
|
||
|
|
||
|
###########################################
|
||
|
# Abstractions and interfaces description #
|
||
|
###########################################
|
||
|
|
||
|
from abc import ABC, abstractmethod
|
||
|
from openbookr.models import Book
|
||
|
|
||
|
|
||
|
class BookCreator(ABC):
|
||
|
"""
|
||
|
An abstract class that describes the creation of a book object
|
||
|
"""
|
||
|
|
||
|
book: Book
|
||
|
|
||
|
@abstractmethod
|
||
|
def _create_book(self, title: str, hashkey: str) -> None:
|
||
|
raise NotImplementedError
|
||
|
|
||
|
def __book__(self) -> Book:
|
||
|
return self.book
|