class Serverkit::Resources::Template
Constants
- DEFAULT_VARIABLES_DATA
Private Instance Methods
content()
click to toggle source
@note Override
# File lib/serverkit/resources/template.rb, line 13 def content @content ||= erb.result(variables.to_mash.binding) end
erb()
click to toggle source
@return [ERB]
# File lib/serverkit/resources/template.rb, line 18 def erb _erb = ::ERB.new(template_content, trim_mode: "-") _erb.filename = source _erb end
template_content()
click to toggle source
@return [String] ERB content
# File lib/serverkit/resources/template.rb, line 25 def template_content @template_content ||= ::File.read(source) end
update_entry()
click to toggle source
@note Override
# File lib/serverkit/resources/template.rb, line 30 def update_entry send_content_to_destination end
variables()
click to toggle source
@return [Serverkit::Variables]
# File lib/serverkit/resources/template.rb, line 35 def variables @variables ||= begin if recipe.variables_path Loaders::VariablesLoader.new(recipe.variables_path).load else Variables.new(DEFAULT_VARIABLES_DATA.dup) end end end