class Serverkit::Loaders::RecipeLoader
Constants
- DEFAULT_VARIABLES_DATA
Public Class Methods
Source
# File lib/serverkit/loaders/recipe_loader.rb, line 14 def initialize(path, variables_path: nil) super(path) @variables_path = variables_path end
@param [String] path @param [String, nil] variables_path
Calls superclass method
Serverkit::Loaders::BaseLoader::new
Private Instance Methods
Source
# File lib/serverkit/loaders/recipe_loader.rb, line 23 def binding_for_erb variables.to_mash.binding end
@note Override @return [Binding]
Source
# File lib/serverkit/loaders/recipe_loader.rb, line 28 def create_empty_loadable loaded_class.new({}, @variables_path) end
@note Override to pass @variables_path
Source
# File lib/serverkit/loaders/recipe_loader.rb, line 32 def has_variables_path? !@variables_path.nil? end
Source
# File lib/serverkit/loaders/recipe_loader.rb, line 37 def load_from_data loaded_class.new(load_data, @variables_path) end
@note Override to pass @variables_path
Source
# File lib/serverkit/loaders/recipe_loader.rb, line 42 def load_variables Loaders::VariablesLoader.new(@variables_path).load end
@return [Serverkit::Variables]
Source
# File lib/serverkit/loaders/recipe_loader.rb, line 47 def loaded_class Serverkit::Recipe end
@note Implementation
Source
# File lib/serverkit/loaders/recipe_loader.rb, line 52 def variables @variables ||= if has_variables_path? load_variables else Variables.new(DEFAULT_VARIABLES_DATA.dup) end end
@return [Serverkit::Variables]