Module: Genome::Core::Helpers::Template

Extended by:
ActiveSupport::Concern
Defined in:
lib/genome/core/helpers/template.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



9
10
11
# File 'lib/genome/core/helpers/template.rb', line 9

def dependencies
  @dependencies
end

#parametersObject (readonly)

Returns the value of attribute parameters.



9
10
11
# File 'lib/genome/core/helpers/template.rb', line 9

def parameters
  @parameters
end

#template_nameObject (readonly)

Returns the value of attribute template_name.



9
10
11
# File 'lib/genome/core/helpers/template.rb', line 9

def template_name
  @template_name
end

Instance Method Details

#initialize(template_name, template_parameters, dependencies) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/genome/core/helpers/template.rb', line 11

def initialize(template_name, template_parameters, dependencies)
  @template_name = template_name
  @parameters = {}
  @dependencies = dependencies || []

  template_parameters.each do |parameter_name, parameter_value|
    if property_configs.key?(parameter_name)
      @parameters[parameter_name] = parameter_value
    end
  end
end

#to_hObject



23
24
25
26
27
28
29
30
31
# File 'lib/genome/core/helpers/template.rb', line 23

def to_h
  {
    template_name => {
      Type: self.class.aws_template,
      Properties: parameters,
      DependsOn: dependencies
    }
  }
end