Class: Scrapetor::Dom::Comment
- Inherits:
-
Object
- Object
- Scrapetor::Dom::Comment
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, #doctype?, #document, #element?, #next_element_sibling, #next_sibling, #previous_element_sibling, #previous_sibling, #remove, #replace, #text?
Constructor Details
#initialize(data, parent: nil) ⇒ Comment
Returns a new instance of Comment.
376
377
378
379
|
# File 'lib/scrapetor/dom.rb', line 376
def initialize(data, parent: nil)
@data = data.to_s
@parent = parent
end
|
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
375
376
377
|
# File 'lib/scrapetor/dom.rb', line 375
def data
@data
end
|
Instance Method Details
382
|
# File 'lib/scrapetor/dom.rb', line 382
def ; true; end
|
#content ⇒ Object
381
|
# File 'lib/scrapetor/dom.rb', line 381
def content; @data; end
|
#name ⇒ Object
383
|
# File 'lib/scrapetor/dom.rb', line 383
def name; "#comment"; end
|
#node_type ⇒ Object
386
|
# File 'lib/scrapetor/dom.rb', line 386
def node_type; 8; end
|
#text ⇒ Object
380
|
# File 'lib/scrapetor/dom.rb', line 380
def text; ""; end
|
#to_html ⇒ Object
384
|
# File 'lib/scrapetor/dom.rb', line 384
def to_html; "<!--#{@data}-->"; end
|
#to_s ⇒ Object
385
|
# File 'lib/scrapetor/dom.rb', line 385
def to_s; to_html; end
|