Class: String

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

Direct Known Subclasses

DomString

Instance Method Summary collapse

Instance Method Details

#ansi2htmlObject



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

def ansi2html; _ansi2html.dom_escaped end

#dom(tag = nil, mounted: nil, **attr) ⇒ Object



121
122
123
124
125
126
127
128
129
130
131
# File 'lib/dom.rb', line 121

def dom tag = nil, mounted: nil, **attr
	if tag
		"<%s>%s</%s>".%(
			Dom.format(tag, attr)
			.insert(1, (block_given? ? yield(self) : self).dom_escape(tag)._ansi2html)
		)
	else
		dom_escape
	end
	.dom_escaped.mounted_set(mounted)
end

#dom_escapedObject



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

def dom_escaped; DomString.new(self) end

#jsonml(tag, attr = nil) ⇒ Object



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

def jsonml tag, attr = nil; [*Dom.json_format(tag, attr), self] end

#mountedObject



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

def mounted; nil end