Module: Mote::Helpers

Defined in:
lib/mote.rb

Instance Method Summary collapse

Instance Method Details

#mote(file, params = {}, context = self) ⇒ Object



57
58
59
60
61
62
# File 'lib/mote.rb', line 57

def mote(file, params = {}, context = self)
  template = File.read(file)

  mote_cache[file] ||= Mote.parse(template, context, params.keys, file)
  mote_cache[file][params]
end

#mote_cacheObject



64
65
66
# File 'lib/mote.rb', line 64

def mote_cache
  Thread.current[:_mote_cache] ||= {}
end