Class: Mayu::VDOM::DOM::Comment

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

Instance Attribute Summary

Attributes inherited from Node

#id, #parent

Instance Method Summary collapse

Methods inherited from Node

#append_child, #element?, #insert_before, #next_sibling, #previous_sibling, #remove_child, #text?

Constructor Details

#initialize(document, data) ⇒ Comment

Returns a new instance of Comment.



204
205
206
207
# File 'lib/mayu/vdom/dom.rb', line 204

def initialize(document, data)
  super(document)
  @data = T.let(data, String)
end

Instance Method Details

#comment?Boolean

Returns:

  • (Boolean)


210
# File 'lib/mayu/vdom/dom.rb', line 210

def comment? = true

#to_sObject



213
# File 'lib/mayu/vdom/dom.rb', line 213

def to_s = "<!-- mayu-id: #{id}. #{@data} -->"