Skip to content

How can I include a module? #162

Description

@ejstembler

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

For example, this doesn't work:

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

  # ...
end
NoMethodError: undefined method `include' for #<#<Class:0x000029e70e0ca9f8>:0x000029e70f56a6b0 @__globals={:function_name=>\"my_function\", :function_type=>:http}, @__logger=#<Logger:0x000029e70e0b3398 @level=1, @progname=nil, @default_formatter=#<Logger::Formatter:0x000029e70e0b3258 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000029e70e0b30a0 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDERR>>, @binmode=false, @mon_data=#<Monitor:0x000029e70e0b2fd8>, @mon_data_owner_object_id=2460>>>", ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestp3questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions