Sha256: f73b03c5ea4bb7f7a6c201859885e6687a43bf7ec57c5f0c94269b055ef9c2a2

Contents?: true

Size: 1.06 KB

Versions: 75

Compression:

Stored size: 1.06 KB

Contents

require 'json'

# Jets::Lambda::Functions represents a collection of Lambda functions.
#
# Jets::Lambda::Functions is the superclass of:
#   Jets::Controller::Base
#   Jets::Job::Base
module Jets::Lambda
  class Functions
    attr_reader :event, :context, :meth
    def initialize(event, context, meth)
      @event = HashWithIndifferentAccess.new(event) # Hash, JSON.parse(event) ran BaseProcessor
      @context = context # Hash. JSON.parse(context) ran in BaseProcessor
      @meth = meth
      # store meth because it is useful to for identifying the which template
      # to use later.
    end

    include Dsl # At the end so methods like event, context and method
      # do not trigger method_added

    class << self
      # Tracking subclasses because it helps with Lambda::Dsl#find_all_tasks
      def subclasses
        @subclasses ||= []
      end

      def inherited(base)
        super
        self.subclasses << base if base.name
      end

      # Needed for depends_on. Got added due to stagger logic.
      def output_keys
        []
      end
    end
  end
end

Version data entries

75 entries across 75 versions & 2 rubygems

Version Path
jets-2.3.6 lib/jets/lambda/functions.rb
jets-2.3.5 lib/jets/lambda/functions.rb
jets-2.3.4 lib/jets/lambda/functions.rb
jets-2.3.3 lib/jets/lambda/functions.rb
jets-2.3.2 lib/jets/lambda/functions.rb
jets-2.3.1 lib/jets/lambda/functions.rb
jets-2.3.0 lib/jets/lambda/functions.rb
jets-2.2.5 lib/jets/lambda/functions.rb
jets-2.2.4 lib/jets/lambda/functions.rb
jets-2.2.3 lib/jets/lambda/functions.rb
jets-2.2.2 lib/jets/lambda/functions.rb
jets-2.2.1 lib/jets/lambda/functions.rb
jets-2.2.0 lib/jets/lambda/functions.rb
jets-2.1.7 lib/jets/lambda/functions.rb
jets-2.1.6 lib/jets/lambda/functions.rb