You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @ejstembler, apologies for not noticing this sooner.
Conceptually, the block you provide to FunctionsFramework.http is a "function" (i.e. a method), not a class, so you can't call Module#include from it. But you can call Object#extend. The following should work:
That said, let's leave this issue open. You bring up a good use case, and I think it would be good to provide a way to include modules in the underlying class rather than extending every instance individually.
@dazuma Do you already know what you'd like to happen in the block to make include work normally or would a PR for this be acceptable from an outside contributor (me)?
Activity
dazuma commentedon Jun 30, 2023
Hi @ejstembler, apologies for not noticing this sooner.
Conceptually, the block you provide to
FunctionsFramework.httpis a "function" (i.e. a method), not a class, so you can't callModule#includefrom it. But you can callObject#extend. The following should work:dazuma commentedon Jun 30, 2023
That said, let's leave this issue open. You bring up a good use case, and I think it would be good to provide a way to include modules in the underlying class rather than extending every instance individually.
Spaceghost commentedon Jul 26, 2023
@dazuma Do you already know what you'd like to happen in the block to make include work normally or would a PR for this be acceptable from an outside contributor (me)?
akerekes commentedon Jan 3, 2025
@Spaceghost if you're still up to it, a PR would be welcome.
feat: Support include inside functions (GoogleCloudPlatform#162)
feat: Support include inside functions (GoogleCloudPlatform#162)
feat: Support include inside functions (GoogleCloudPlatform#162)
feat: Support include inside functions (GoogleCloudPlatform#162)
feat: Support include inside functions (GoogleCloudPlatform#162)
feat: Support include inside functions (GoogleCloudPlatform#162)
feat: Support include inside functions (GoogleCloudPlatform#162)
feat: Support include inside functions (GoogleCloudPlatform#162)