Class: Nokogiri::HTML::ElementDescription
- Inherits:
-
Object
- Object
- Nokogiri::HTML::ElementDescription
- Defined in:
- lib/nokogiri/html/element_description.rb,
lib/nokogiri/ffi/html/element_description.rb,
ext/nokogiri/html_element_description.c
Instance Attribute Summary collapse
-
#cstruct ⇒ Object
:nodoc:.
Class Method Summary collapse
-
.[](tag_name) ⇒ Object
Get ElemementDescription for
tag_name
.
Instance Method Summary collapse
-
#block? ⇒ Boolean
Is this element a block element?.
-
#default_sub_element ⇒ Object
The default sub element for this element.
-
#deprecated? ⇒ Boolean
Is this element deprecated?.
-
#deprecated_attributes ⇒ Object
A list of deprecated attributes for this element.
-
#description ⇒ Object
The description for this element.
-
#empty? ⇒ Boolean
Is this an empty element?.
-
#implied_end_tag? ⇒ Boolean
Can the end tag be implied for this tag?.
-
#implied_start_tag? ⇒ Boolean
Can the start tag be implied for this tag?.
-
#inline? ⇒ Boolean
Is this element an inline element?.
-
#inspect ⇒ Object
Inspection information.
-
#name ⇒ Object
Get the tag name for this ElemementDescription.
-
#optional_attributes ⇒ Object
A list of optional attributes for this element.
-
#required_attributes ⇒ Object
A list of required attributes for this element.
-
#save_end_tag? ⇒ Boolean
Should the end tag be saved?.
-
#sub_elements ⇒ Object
A list of allowed sub elements for this element.
-
#to_s ⇒ Object
Convert this description to a string.
Instance Attribute Details
#cstruct ⇒ Object
:nodoc:
5 6 7 |
# File 'lib/nokogiri/ffi/html/element_description.rb', line 5 def cstruct @cstruct end |
Class Method Details
.[](tag_name) ⇒ Object
Get ElemementDescription for tag_name
59 60 61 62 63 64 65 66 |
# File 'lib/nokogiri/ffi/html/element_description.rb', line 59 def self.[](tag_name) # :nodoc: ptr = LibXML.htmlTagLookup(tag_name) return nil if ptr.null? desc = allocate desc.cstruct = LibXML::HtmlElemDesc.new(ptr) desc end |
Instance Method Details
#block? ⇒ Boolean
Is this element a block element?
6 7 8 |
# File 'lib/nokogiri/html/element_description.rb', line 6 def block? !inline? end |
#default_sub_element ⇒ Object
The default sub element for this element
19 20 21 |
# File 'lib/nokogiri/ffi/html/element_description.rb', line 19 def default_sub_element # :nodoc: cstruct[:defaultsubelt] end |
#deprecated? ⇒ Boolean
Is this element deprecated?
35 36 37 |
# File 'lib/nokogiri/ffi/html/element_description.rb', line 35 def deprecated? # :nodoc: cstruct[:depr] != 0 end |
#deprecated_attributes ⇒ Object
A list of deprecated attributes for this element
11 12 13 |
# File 'lib/nokogiri/ffi/html/element_description.rb', line 11 def deprecated_attributes # :nodoc: get_string_array_from :attrs_depr end |
#description ⇒ Object
The description for this element
27 28 29 |
# File 'lib/nokogiri/ffi/html/element_description.rb', line 27 def description # :nodoc: cstruct[:desc] end |
#empty? ⇒ Boolean
Is this an empty element?
39 40 41 |
# File 'lib/nokogiri/ffi/html/element_description.rb', line 39 def empty? # :nodoc: cstruct[:empty] != 0 end |
#implied_end_tag? ⇒ Boolean
Can the end tag be implied for this tag?
47 48 49 |
# File 'lib/nokogiri/ffi/html/element_description.rb', line 47 def implied_end_tag? # :nodoc: cstruct[:endTag] != 0 end |
#implied_start_tag? ⇒ Boolean
Can the start tag be implied for this tag?
51 52 53 |
# File 'lib/nokogiri/ffi/html/element_description.rb', line 51 def implied_start_tag? # :nodoc: cstruct[:startTag] != 0 end |
#inline? ⇒ Boolean
Is this element an inline element?
31 32 33 |
# File 'lib/nokogiri/ffi/html/element_description.rb', line 31 def inline? # :nodoc: cstruct[:isinline] != 0 end |
#inspect ⇒ Object
Inspection information
18 19 20 |
# File 'lib/nokogiri/html/element_description.rb', line 18 def inspect "#<#{self.class.name}: #{name} #{description}>" end |
#name ⇒ Object
Get the tag name for this ElemementDescription
55 56 57 |
# File 'lib/nokogiri/ffi/html/element_description.rb', line 55 def name # :nodoc: cstruct[:name] end |
#optional_attributes ⇒ Object
A list of optional attributes for this element
15 16 17 |
# File 'lib/nokogiri/ffi/html/element_description.rb', line 15 def optional_attributes # :nodoc: get_string_array_from :attrs_opt end |
#required_attributes ⇒ Object
A list of required attributes for this element
7 8 9 |
# File 'lib/nokogiri/ffi/html/element_description.rb', line 7 def required_attributes # :nodoc: get_string_array_from :attrs_req end |
#save_end_tag? ⇒ Boolean
Should the end tag be saved?
43 44 45 |
# File 'lib/nokogiri/ffi/html/element_description.rb', line 43 def save_end_tag? # :nodoc: cstruct[:saveEndTag] != 0 end |
#sub_elements ⇒ Object
A list of allowed sub elements for this element.
23 24 25 |
# File 'lib/nokogiri/ffi/html/element_description.rb', line 23 def sub_elements # :nodoc: get_string_array_from :subelts end |
#to_s ⇒ Object
Convert this description to a string
12 13 14 |
# File 'lib/nokogiri/html/element_description.rb', line 12 def to_s "#{name}: #{description}" end |