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



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

def % v; super(v).escaped end

#escape_ajaxObject

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



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

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

#escape_html(tag) ⇒ Object



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

def escape_html tag; self end

#to_sObject



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

def to_s; self end