Class: Murk::Model::Template

Inherits:
Object
  • Object
show all
Includes:
Murk, AWS
Defined in:
lib/murk/model/template.rb

Constant Summary

Constants included from Murk

DEFAULT_OPTIONS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AWS

#cloudformation

Methods included from Murk

config_dir, config_file, config_file=, configure, load, logger, #logger, logger=, options

Constructor Details

#initialize(filename) ⇒ Template

Returns a new instance of Template.



13
14
15
# File 'lib/murk/model/template.rb', line 13

def initialize(filename)
  @filename = filename
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



11
12
13
# File 'lib/murk/model/template.rb', line 11

def filename
  @filename
end

Instance Method Details

#bodyObject



21
22
23
# File 'lib/murk/model/template.rb', line 21

def body
  File.read(path)
end

#parameter?(parameter_key) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/murk/model/template.rb', line 29

def parameter?(parameter_key)
  parameters.any? { |param| param.parameter_key == parameter_key.to_s }
end

#parametersObject



25
26
27
# File 'lib/murk/model/template.rb', line 25

def parameters
  validate.parameters
end

#pathObject



17
18
19
# File 'lib/murk/model/template.rb', line 17

def path
  @path ||= resolve_path(@filename)
end