Class: Fdlint::Parser::HTML::Document
- Defined in:
- lib/fdlint/parser/html/struct.rb
Constant Summary
Constants included from Query
Query::CLASS, Query::ID, Query::PROP, Query::PROP_PAIR, Query::WORD
Instance Attribute Summary
Attributes inherited from Element
#children, #close_type, #ending, #parent, #position, #props, #scopes, #tag
Instance Method Summary collapse
- #==(other) ⇒ Object
- #empty? ⇒ Boolean
- #has_dtd? ⇒ Boolean (also: #have_dtd?)
-
#initialize(children = []) ⇒ Document
constructor
A new instance of Document.
- #outer_html ⇒ Object
Methods included from Query
Methods included from Matchable
Methods inherited from Element
#[], #auto_close?, #closed?, #each, #has_prop?, #has_scope?, #in_scope?, #inline?, #inner_html, #inner_text, #prop, #prop_text, #prop_value, #self_closed?, #stylesheet_link?, #tag_name, #to_s, #top_level?
Constructor Details
Instance Method Details
#==(other) ⇒ Object
207 208 209 210 211 212 213 214 215 |
# File 'lib/fdlint/parser/html/struct.rb', line 207 def ==(other) if other.is_a?(Array) return children == other elsif other.is_a?(Document) return children == other.children else super end end |
#empty? ⇒ Boolean
217 218 219 |
# File 'lib/fdlint/parser/html/struct.rb', line 217 def empty? children.empty? end |
#has_dtd? ⇒ Boolean Also known as: have_dtd?
221 222 223 |
# File 'lib/fdlint/parser/html/struct.rb', line 221 def has_dtd? !empty? && children.first.is_a?( DTDElement ) end |
#outer_html ⇒ Object
227 228 229 |
# File 'lib/fdlint/parser/html/struct.rb', line 227 def outer_html children.map(&:outer_html).to_a.join end |