Class: Jets::Cfn::TemplateSource
- Inherits:
-
Object
- Object
- Jets::Cfn::TemplateSource
- Includes:
- AwsServices
- Defined in:
- lib/jets/cfn/template_source.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(path, options) ⇒ TemplateSource
constructor
A new instance of TemplateSource.
- #to_h ⇒ Object
- #url ⇒ Object
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
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, ) @path = path @options = end |
Instance Attribute Details
#path ⇒ Object (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
#body ⇒ Object
12 13 14 |
# File 'lib/jets/cfn/template_source.rb', line 12 def body @body ||= IO.read(path) end |
#to_h ⇒ Object
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 |
#url ⇒ Object
16 17 18 |
# File 'lib/jets/cfn/template_source.rb', line 16 def url @url ||= upload_file_to_s3 end |