Class: DomString

Inherits:
String show all
Defined in:
lib/dom.rb

Constant Summary

Constants inherited from String

String::AnsiColor

Instance Method Summary collapse

Methods inherited from String

#ansi2html, #dom, #escaped, #jsonml

Instance Method Details

#%(v) ⇒ Object



84
# File 'lib/dom.rb', line 84

def % v; super(v).escaped end

#escape_ajaxObject

Newline in Javascript terminates the command, causing ‘Unterminated string literal` error



88
# File 'lib/dom.rb', line 88

def escape_ajax; tr($/, "\\\n".freeze).to_json end

#escape_html(tag) ⇒ Object



86
# File 'lib/dom.rb', line 86

def escape_html tag; self end

#to_sObject



85
# File 'lib/dom.rb', line 85

def to_s; self end