Sha256: c3ab2e55e6b1f19d978de2afaec1e2648a61853d7fb7b5f83d6df87fd0b271bf
Contents?: true
Size: 607 Bytes
Versions: 14
Compression:
Stored size: 607 Bytes
Contents
module Hyalite::DOM class Document include Native include Node def create_element(tag) Element.new `self.native.createElement(tag)` end def create_text(text) Text.new `self.native.createTextNode(text)` end def body Body.new `self.native.body` end def ready(&block) `self.native.addEventListener('DOMContentLoaded', block)` end def self.singleton @singleton ||= self.new(`window.document`) end def document? true end def [](q) Collection.new `self.native.querySelectorAll(#{q})` end end end
Version data entries
14 entries across 14 versions & 1 rubygems