'Initialize this class with the given :class:`flask.Flask`
application or :class:`flask.Blueprint` object.
:param app: the Flask application or blueprint object
:type app: flask.Flask
:type app: flask.Blueprint
Examples::
api = Api()
api.add_resource(...)
api.init_app(app)'

def init_app(self, app):

    try:
        app.record(self._deferred_blueprint_init)
    except AttributeError:
        self._init_app(app)
    else:
        self.blueprint = app
