class Pipely::Build::Template

An ERB template that can be interpolated with config hashes to render a deployable pipeline definition.

Attributes

pipeline_id[RW]

Public Class Methods

new(source) click to toggle source
# File lib/pipely/build/template.rb, line 17
def initialize(source)
  @source = source
  @config = {}
end

Public Instance Methods

apply_config(attributes) click to toggle source
# File lib/pipely/build/template.rb, line 22
def apply_config(attributes)
  @config.merge!(attributes.symbolize_keys)
end
method_missing(method_name, *args, &block) click to toggle source
Calls superclass method
# File lib/pipely/build/template.rb, line 34
def method_missing(method_name, *args, &block)
  if @config.keys.include?(method_name)
    @config[method_name]
  else
    super
  end
end
respond_to_missing(method_name, include_private=false) click to toggle source
Calls superclass method
# File lib/pipely/build/template.rb, line 30
def respond_to_missing(method_name, include_private=false)
  @config.keys.include?(method_name.to_s) || super
end
to_json() click to toggle source
# File lib/pipely/build/template.rb, line 26
def to_json
  ERB.new(@source).result(binding)
end