Method: BitClust::NameUtils.encodename_rdocurl

Defined in:
lib/bitclust/nameutils.rb

.encodename_rdocurl(str) ⇒ Object

string -> encoded string in a rdoc way



221
222
223
224
225
226
# File 'lib/bitclust/nameutils.rb', line 221

def encodename_rdocurl(str)
  str = str.gsub(/[^A-Za-z0-9_.]/n) {|ch|
    sprintf('-%02X', ch[0].ord)
  }
  str.sub(/\A-/, '')
end