def app(self):
        """Internal method that will supply the app to use internally.

        Returns:
            flask.Flask: The app to use within the component.

        Raises:
            RuntimeError: This is raised if no app was provided to the
                component and the method is being called outside of an
                application context.
        """
        app = self._app or current_app

        if not in_app_context(app):
            raise RuntimeError("This component hasn't been initialized yet "
                               "and an app context doesn't exist.")

        # If current_app is the app, this must be used in order for their IDs
        # to be the same, as current_app will wrap the app in a proxy.
        if hasattr(app, '_get_current_object'):
            app = app._get_current_object()

        return app
Internal method that will supply the app to use internally.

        Returns:
            flask.Flask: The app to use within the component.

        Raises:
            RuntimeError: This is raised if no app was provided to the
                component and the method is being called outside of an
                application context.