Class: Fdlint::Parser::HTML::DTDElement
- 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 collapse
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Element
#children, #close_type, #ending, #parent, #position, #props, #scopes, #tag
Instance Method Summary collapse
- #==(other) ⇒ Object
- #=~(other) ⇒ Object
-
#initialize(type, pre = "DOCTYPE", pos = nil) ⇒ DTDElement
constructor
A new instance of DTDElement.
- #inline? ⇒ Boolean
- #to_s ⇒ Object (also: #outer_html)
Methods included from Query
Methods inherited from Element
#[], #auto_close?, #closed?, #each, #empty?, #has_prop?, #has_scope?, #in_scope?, #inner_html, #inner_text, #prop, #prop_text, #prop_value, #self_closed?, #stylesheet_link?, #tag_name, #top_level?
Constructor Details
#initialize(type, pre = "DOCTYPE", pos = nil) ⇒ DTDElement
Returns a new instance of DTDElement.
302 303 304 305 |
# File 'lib/fdlint/parser/html/struct.rb', line 302 def initialize(type, pre="DOCTYPE", pos=nil) @type, @pre = type, pre @position = pos || Position.new(0,0,0) end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
300 301 302 |
# File 'lib/fdlint/parser/html/struct.rb', line 300 def type @type end |
Instance Method Details
#==(other) ⇒ Object
317 318 319 |
# File 'lib/fdlint/parser/html/struct.rb', line 317 def ==(other) other.is_a?(DTDElement) and other.type == type end |
#=~(other) ⇒ Object
321 322 323 |
# File 'lib/fdlint/parser/html/struct.rb', line 321 def =~(other) to_s =~ other end |
#inline? ⇒ Boolean
311 312 313 |
# File 'lib/fdlint/parser/html/struct.rb', line 311 def inline? true end |
#to_s ⇒ Object Also known as: outer_html
307 308 309 |
# File 'lib/fdlint/parser/html/struct.rb', line 307 def to_s "<!#{@pre} #{type}>" end |