Class: Stackup::Source
- Inherits:
-
Object
- Object
- Stackup::Source
- Defined in:
- lib/stackup/source.rb
Overview
Represents a source of input, e.g. template, parameter, etc.
Defined Under Namespace
Classes: ReadError
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Instance Method Summary collapse
- #body ⇒ Object
- #data ⇒ Object
-
#initialize(location) ⇒ Source
constructor
A new instance of Source.
- #s3? ⇒ Boolean
Constructor Details
#initialize(location) ⇒ Source
Returns a new instance of Source.
12 13 14 |
# File 'lib/stackup/source.rb', line 12 def initialize(location) @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
16 17 18 |
# File 'lib/stackup/source.rb', line 16 def location @location end |
Instance Method Details
#body ⇒ Object
23 24 25 |
# File 'lib/stackup/source.rb', line 23 def body @body ||= read end |
#data ⇒ Object
27 28 29 |
# File 'lib/stackup/source.rb', line 27 def data @data ||= parse_body end |
#s3? ⇒ Boolean
18 19 20 21 |
# File 'lib/stackup/source.rb', line 18 def s3? uri.scheme == "https" && uri.host =~ /(^|\.)s3((\.|-)\w+-\w+-\d)?\.amazonaws\.com$/ end |