Class: Stackup::Source

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(location) ⇒ Source

Returns a new instance of Source.



11
12
13
# File 'lib/stackup/source.rb', line 11

def initialize(location)
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



15
16
17
# File 'lib/stackup/source.rb', line 15

def location
  @location
end

Instance Method Details

#bodyObject



22
23
24
# File 'lib/stackup/source.rb', line 22

def body
  @body ||= read
end

#dataObject



26
27
28
# File 'lib/stackup/source.rb', line 26

def data
  @data ||= parse_body
end

#s3?Boolean

Returns:

  • (Boolean)


17
18
19
20
# File 'lib/stackup/source.rb', line 17

def s3?
  uri.scheme == "https" &&
  uri.host =~ %r{(^|\.)s3(-\w+-\w+-\d)?\.amazonaws\.com$}
end