Sha256: 21217123480bf00b4ba51fd8f0530fc8a2015933bc4228e0a9fe6e205aad9663

Contents?: true

Size: 480 Bytes

Versions: 30

Compression:

Stored size: 480 Bytes

Contents

module FaaStRuby
  class Event
    attr_accessor :body, :query_params, :headers, :context
    def initialize(body:, query_params:, headers:, context:)
      @body = body
      @query_params = query_params
      @headers = headers
      @context = context
    end
    def to_h
      {
        "body" => @body,
        "query_params" => @query_params,
        "headers" => @headers,
        "context" => @context
      }
    end
    def to_json
      Oj.dump(to_h)
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
faastruby-0.5.30 lib/faastruby/server/event.rb
faastruby-0.5.29 lib/faastruby/server/event.rb
faastruby-0.5.28 lib/faastruby/server/event.rb
faastruby-0.5.27 lib/faastruby/server/event.rb
faastruby-0.5.26 lib/faastruby/server/event.rb
faastruby-0.5.25 lib/faastruby/server/event.rb
faastruby-0.5.24 lib/faastruby/server/event.rb
faastruby-0.5.23 lib/faastruby/server/event.rb
faastruby-0.5.22 lib/faastruby/server/event.rb
faastruby-0.5.21 lib/faastruby/server/event.rb
faastruby-0.5.20 lib/faastruby/server/event.rb
faastruby-0.5.19 lib/faastruby/server/event.rb
faastruby-0.5.18 lib/faastruby/server/event.rb
faastruby-0.5.17 lib/faastruby/server/event.rb
faastruby-0.5.16 lib/faastruby/server/event.rb
faastruby-0.5.15 lib/faastruby/server/event.rb
faastruby-0.5.14 lib/faastruby/server/event.rb
faastruby-0.5.13 lib/faastruby/server/event.rb
faastruby-0.5.12 lib/faastruby/server/event.rb
faastruby-0.5.11 lib/faastruby/server/event.rb