Class: AWS::CloudFormation::Helper

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_cloudformation_helper.rb,
lib/aws_cloudformation_helper/event.rb,
lib/aws_cloudformation_helper/logger.rb,
lib/aws_cloudformation_helper/version.rb,
lib/aws_cloudformation_helper/response.rb

Overview

Main module

Defined Under Namespace

Modules: Version Classes: Event, Logger, Response

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lambda_class, event, context) ⇒ Helper

Returns a new instance of Helper.



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

def initialize(lambda_class, event, context)
  # Ruby context object: https://docs.aws.amazon.com/lambda/latest/dg/ruby-context.html
  @context = context

  # Initialize event object
  @event = Event.new(event, lambda_class.method(:create),
                     lambda_class.method(:delete), lambda_class.method(:update))
  Event.instance = @event
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



13
14
15
# File 'lib/aws_cloudformation_helper.rb', line 13

def context
  @context
end

#eventObject (readonly)

Returns the value of attribute event.



12
13
14
# File 'lib/aws_cloudformation_helper.rb', line 12

def event
  @event
end

Class Method Details

.loggerObject



25
26
27
28
# File 'lib/aws_cloudformation_helper.rb', line 25

def self.logger
  @logger ||= Logger.new
  @logger
end

Instance Method Details

#loggerObject



30
31
32
# File 'lib/aws_cloudformation_helper.rb', line 30

def logger
  self.class.logger
end