Class: Ufo::Param

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Defined in:
lib/ufo/param.rb

Instance Method Summary collapse

Constructor Details

#initializeParam

Returns a new instance of Param.



7
8
9
# File 'lib/ufo/param.rb', line 7

def initialize
  @params_path = "#{Ufo.root}/.ufo/params.yml"
end

Instance Method Details

#dataObject



11
12
13
14
15
16
17
# File 'lib/ufo/param.rb', line 11

def data
  return {} unless File.exist?(@params_path)

  result = RenderMePretty.result(@params_path, context: template_scope)
  data = YAML.load(result) || {}
  data.deep_symbolize_keys
end

#template_scopeObject



20
21
22
# File 'lib/ufo/param.rb', line 20

def template_scope
  @template_scope ||= Ufo::TemplateScope.new(Ufo::DSL::Helper.new, nil)
end