(self)
return text_block
Returns a dict with the block data.

        Raises:
            ValueError: if the block has not been fed with data.
            TypeError: if the data that was fed is of the wrong type.

        Returns:
            A dict with the block data.
Returns a dict with the block data.
Returns a dict with the block data .
def to_dict(self):
        """Returns a dict with the block data.

        Raises:
            ValueError: if the block has not been fed with data.
            TypeError: if the data that was fed is of the wrong type.

        Returns:
            A dict with the block data.
        """
        if not self._data:
            raise ValueError('No data has been fed to the block.')

        if not isinstance(self._data, str):
            raise TypeError('Data to a text block needs to be a string.')

        text_block = self._get_base()
        text_block['content'] = self._data

        return text_block
def to_dict ( self ) : if not self . _data : raise ValueError ( 'No data has been fed to the block.' ) if not isinstance ( self . _data , str ) : raise TypeError ( 'Data to a text block needs to be a string.' ) text_block = self . _get_base ( ) text_block [ 'content' ] = self . _data return text_block