Class: Scrapetor::Dom::Doctype
- Inherits:
-
Object
- Object
- Scrapetor::Dom::Doctype
show all
- Includes:
- NodeMethods
- Defined in:
- lib/scrapetor/dom.rb
Instance Attribute Summary collapse
Attributes included from NodeMethods
#parent
Instance Method Summary
collapse
#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
#name ⇒ Object
Returns the value of attribute name.
391
392
393
|
# File 'lib/scrapetor/dom.rb', line 391
def name
@name
end
|
Instance Method Details
#content ⇒ Object
397
|
# File 'lib/scrapetor/dom.rb', line 397
def content; ""; end
|
#doctype? ⇒ Boolean
398
|
# File 'lib/scrapetor/dom.rb', line 398
def doctype?; true; end
|
#node_type ⇒ Object
401
|
# File 'lib/scrapetor/dom.rb', line 401
def node_type; 10; end
|
#text ⇒ Object
396
|
# File 'lib/scrapetor/dom.rb', line 396
def text; ""; end
|
#to_html ⇒ Object
399
|
# File 'lib/scrapetor/dom.rb', line 399
def to_html; "<!DOCTYPE #{@name}>"; end
|
#to_s ⇒ Object
400
|
# File 'lib/scrapetor/dom.rb', line 400
def to_s; to_html; end
|