Class: Jets::Cfn::TemplateSource

Inherits:
Object
  • Object
show all
Includes:
AwsServices
Defined in:
lib/jets/cfn/template_source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AwsServices

#apigateway, #aws_lambda, #aws_options, #cfn, #dynamodb, #logs, #s3, #s3_resource, #sns, #sqs, #sts

Methods included from AwsServices::StackStatus

#lookup, #stack_exists?, #stack_in_progress?

Methods included from AwsServices::GlobalMemoist

included

Constructor Details

#initialize(path, options) ⇒ TemplateSource

Returns a new instance of TemplateSource.



7
8
9
10
# File 'lib/jets/cfn/template_source.rb', line 7

def initialize(path, options)
  @path = path
  @options = options
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/jets/cfn/template_source.rb', line 5

def path
  @path
end

Instance Method Details

#bodyObject



12
13
14
# File 'lib/jets/cfn/template_source.rb', line 12

def body
  @body ||= IO.read(path)
end

#to_hObject



20
21
22
23
24
25
26
# File 'lib/jets/cfn/template_source.rb', line 20

def to_h
  if upload_to_s3?
    from_s3
  else
    from_path
  end
end

#urlObject



16
17
18
# File 'lib/jets/cfn/template_source.rb', line 16

def url
  @url ||= upload_file_to_s3
end