class Nydp::Html::PercentEncode

Public Instance Methods

invoke_2(vm, arg) click to toggle source
# File lib/nydp/html.rb, line 40
def invoke_2 vm, arg
  vm.push_arg Nydp::StringAtom.new percent_encode arg.to_s
end
percent_encode(s) click to toggle source
# File lib/nydp/html.rb, line 44
def percent_encode s
  s.gsub('%', '%25').gsub(/[ \n"\?.<>\\^_`{\|}~\[\]\/]/) { |x| "%%%2X" % x.ord }
end