Class: Array

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

Instance Method Summary collapse

Instance Method Details

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



107
108
109
110
111
# File 'lib/dom.rb', line 107

def dom tag, mounted: nil, **attr
	_tag = Dom.hyphenize(tag)
	("<%s%s>%s</%s>".freeze % [_tag, Dom.attr(attr), Dom.join(self, tag), _tag])
	.dom_escaped.mounted_set(*map(&:mounted), mounted)
end

#jsonml(tag, attr = nil) ⇒ Object



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

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