Class: XRay::HTML::CommentElement

Inherits:
Element
  • Object
show all
Defined in:
lib/html/struct.rb

Constant Summary

Constants inherited from Element

Element::CLASS, Element::ID, Element::PROP, Element::PROP_PAIR, Element::WORD

Instance Attribute Summary

Attributes inherited from Element

#children, #close_type, #ending, #parent, #props, #scopes, #tag

Instance Method Summary collapse

Methods inherited from Element

#each, #empty?, #has_prop?, #has_scope?, #in_scope?, #match?, #prop, #prop_text, #prop_value, #query, #self_closed?

Constructor Details

#initialize(text) ⇒ CommentElement

Returns a new instance of CommentElement.



205
206
207
208
# File 'lib/html/struct.rb', line 205

def initialize(text)
  super(nil)
  @text = text.to_s
end

Instance Method Details

#==(other) ⇒ Object



220
221
222
# File 'lib/html/struct.rb', line 220

def ==(other)
  text == other.text
end

#auto_close?Boolean

Returns:

  • (Boolean)


226
# File 'lib/html/struct.rb', line 226

def auto_close? ; false; end

#closed?Boolean

Returns:

  • (Boolean)


227
# File 'lib/html/struct.rb', line 227

def closed? ; true; end

#contentObject



210
# File 'lib/html/struct.rb', line 210

def content; @text; end

#inline?Boolean

Returns:

  • (Boolean)


225
# File 'lib/html/struct.rb', line 225

def inline? ; true; end

#outer_htmlObject



216
217
218
# File 'lib/html/struct.rb', line 216

def outer_html
  "<!--#{text}-->"
end

#tag_nameObject



211
# File 'lib/html/struct.rb', line 211

def tag_name; nil; end

#tag_name_equal?(name) ⇒ Boolean

Returns:

  • (Boolean)


224
# File 'lib/html/struct.rb', line 224

def tag_name_equal?(name); false; end

#to_sObject



229
230
231
# File 'lib/html/struct.rb', line 229

def to_s
  "[Comment: #{text}]"
end