Class: Fdlint::Parser::HTML::DTDElement

Inherits:
Tag show all
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

Attributes inherited from Element

#children, #close_type, #ending, #parent, #position, #props, #scopes, #tag

Instance Method Summary collapse

Methods included from Query

#match?, #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

#typeObject

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

Returns:

  • (Boolean)


311
312
313
# File 'lib/fdlint/parser/html/struct.rb', line 311

def inline?
  true
end

#to_sObject Also known as: outer_html



307
308
309
# File 'lib/fdlint/parser/html/struct.rb', line 307

def to_s
  "<!#{@pre} #{type}>"
end