GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-ruby

How can I include a module?

Ouverte
#162 4 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
enhancement p3 question
Langage dominant
Ruby
Étoiles
164
Forks
47
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Normally one would add module includes inside the class. How can this be done with `FunctionsFramework`?

For example, this doesn't work:

```ruby
FunctionsFramework.http 'my_function' do |request|
include GoogleCloudLoggable

# ...
end
```

```text
NoMethodError: undefined method `include' for #<#:0x000029e70f56a6b0 @__globals={:function_name=>\"my_function\", :function_type=>:http}, @__logger=#, @formatter=nil, @logdev=#>, @binmode=false, @mon_data=#, @mon_data_owner_object_id=2460>>>", ...
```

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start by reading the FunctionsFramework HTTP registration path and the example in the issue to understand what object receives the block. Check whether module inclusion is supported there or requires a documented alternative. Done means the supported usage or limitation is clearly documented and addresses the shown NoMethodError.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
ruby
Domaine
backend
Type d'issue
Documentation
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
30/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.