Class: Hanami::Lambda::Function Private

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami/lambda/function.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

The base class for handler

Since:

  • 0.2.0

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.inherited(subclass) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Override the Ruby’s hook for modules

Parameters:

  • base (Class)

    the target class

Since:

  • 0.2.0



15
16
17
18
19
20
21
22
23
# File 'lib/hanami/lambda/function.rb', line 15

def self.inherited(subclass)
  super

  subclass.extend ClassMethods

  if instance_variable_defined?(:@event_type)
    subclass.instance_variable_set(:@event_type, @event_type)
  end
end

Instance Method Details

#call(event:, context:) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.2.0



48
49
50
51
# File 'lib/hanami/lambda/function.rb', line 48

def call(event:, context:)
  event = self.class.event_type.new(event)
  handle(event, context)
end