Class: PaperclipLambda::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/paperclip_lambda/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(function_name, payload = {}) ⇒ Client

Returns a new instance of Client.



7
8
9
10
11
12
# File 'lib/paperclip_lambda/client.rb', line 7

def initialize(function_name, payload = {})
  lambda = ::Aws::Lambda::Client.new
  lambda.invoke(function_name: function_name, payload: payload.to_json, invocation_type: "Event")
rescue ::Aws::Lambda::Errors::ServiceError => e
  @errors = e
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



5
6
7
# File 'lib/paperclip_lambda/client.rb', line 5

def errors
  @errors
end