module Mote::Helpers

Public Instance Methods

mote(file, params = {}, context = self) click to toggle source
# File lib/mote-angular.rb, line 53
def mote(file, params = {}, context = self)
  page_vars = "#{file}:pagevars"
  if !mote_cache[file] || mote_cache[page_vars] != params
    mote_cache[file] = Mote.parse(File.read(file), context, params.keys)
    mote_cache[page_vars] = params
  end
  mote_cache[file][params]
end
mote_cache() click to toggle source
# File lib/mote-angular.rb, line 62
def mote_cache
  Thread.current[:_mote_cache] ||= {}
end