Class: Scrapetor::Dom::Doctype

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

Instance Attribute Summary collapse

Attributes included from NodeMethods

#parent

Instance Method Summary collapse

Methods included from NodeMethods

#add_next_sibling, #add_previous_sibling, #comment?, #document, #element?, #next_element_sibling, #next_sibling, #previous_element_sibling, #previous_sibling, #remove, #replace, #text?

Constructor Details

#initialize(name, parent: nil) ⇒ Doctype

Returns a new instance of Doctype.



392
393
394
395
# File 'lib/scrapetor/dom.rb', line 392

def initialize(name, parent: nil)
  @name = name.to_s
  @parent = parent
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



391
392
393
# File 'lib/scrapetor/dom.rb', line 391

def name
  @name
end

Instance Method Details

#contentObject



397
# File 'lib/scrapetor/dom.rb', line 397

def content;  ""; end

#doctype?Boolean

Returns:

  • (Boolean)


398
# File 'lib/scrapetor/dom.rb', line 398

def doctype?; true; end

#node_typeObject



401
# File 'lib/scrapetor/dom.rb', line 401

def node_type; 10; end

#textObject



396
# File 'lib/scrapetor/dom.rb', line 396

def text;     ""; end

#to_htmlObject



399
# File 'lib/scrapetor/dom.rb', line 399

def to_html;  "<!DOCTYPE #{@name}>"; end

#to_sObject



400
# File 'lib/scrapetor/dom.rb', line 400

def to_s;     to_html; end