Class: Lambchop::Cat

Inherits:
Object
  • Object
show all
Defined in:
lib/lambchop/cat.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(function_name, invoke_args, options = {}) ⇒ Cat

Returns a new instance of Cat.



6
7
8
9
10
11
# File 'lib/lambchop/cat.rb', line 6

def initialize(function_name, invoke_args, options = {})
  @function_name = function_name
  @invoke_args   = invoke_args
  @client        = options[:client] || Aws::Lambda::Client.new
  @options       = options
end

Class Method Details

.cat(function_name, invoke_args, options = {}) ⇒ Object



2
3
4
# File 'lib/lambchop/cat.rb', line 2

def self.cat(function_name, invoke_args, options = {})
  self.new(function_name, invoke_args, options).cat
end

Instance Method Details

#catObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/lambchop/cat.rb', line 13

def cat
  invoke_args = @invoke_args

  if invoke_args.kind_of?(IO)
    invoke_args = invoke_args.read
  end

  @client.invoke_async(
    :function_name => @function_name,
    :invoke_args => invoke_args
  )
end