Module: HMote::Helpers

Defined in:
lib/hmote.rb

Instance Method Summary collapse

Instance Method Details

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



38
39
40
41
# File 'lib/hmote.rb', line 38

def hmote(file, params = {}, context = self)
  hmote_cache[file] ||= HMote.parse(File.read(file), context, params.keys)
  hmote_cache[file].call(params)
end

#hmote_cacheObject



43
44
45
# File 'lib/hmote.rb', line 43

def hmote_cache
  Thread.current[:_hmote_cache] ||= {}
end