Class: Jets::Cfn::BuiltTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/jets/cfn/built_template.rb

Overview

Caches the built template to reduce filesystem IO calls.

Constant Summary collapse

@@cache =
{}

Class Method Summary collapse

Class Method Details

.get(path) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/jets/cfn/built_template.rb', line 6

def get(path)
  if @@cache[path]
    @@cache[path] # using cache
  else
    @@cache[path] = YAML.load_file(path) # setting and using cache
  end
end