Class: WWW_App::Sanitize

Inherits:
Object
  • Object
show all
Defined in:
lib/www_app.rb

Constant Summary collapse

MUSTACHE_Regex =
/\A\{\{\{? [a-z0-9\_\.]+ \}\}\}?\z/i

Class Method Summary collapse

Class Method Details

.method_missing(name, *args) ⇒ Object



1067
1068
1069
1070
1071
1072
# File 'lib/www_app.rb', line 1067

def method_missing name, *args
  if args.last.is_a?(::Symbol)
    args.push(args.pop.to_s)
  end
  ::Escape_Escape_Escape.send(name, *args)
end

.mustache(*args) ⇒ Object



1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
# File 'lib/www_app.rb', line 1056

def mustache *args
  meth, val = args
  if val.is_a?(Symbol)
    m = "{{{ #{meth}.#{val} }}}"
    fail "Unknown chars: #{args.inspect}" unless m[MUSTACHE_Regex]
  else
    m = ::Escape_Escape_Escape.send(meth, val)
  end
  m
end