This is filled in down below.
Methods are defined protected by method_defined? because at this point the C-library or Java library is already loaded, and we don’t want to clobber any methods that have been defined there.
Attributes defined and categorized
Get ElemementDescription for tag_name
static VALUE get_description(VALUE klass, VALUE tag_name)
{
const htmlElemDesc * description = htmlTagLookup(
(const xmlChar *)StringValuePtr(tag_name)
);
if(NULL == description) return Qnil;
return Data_Wrap_Struct(klass, 0, 0, (void *)description);
}
Is this element a block element?
# File lib/nokogiri/html/element_description.rb, line 6 def block? !inline? end
The default sub element for this element
# File lib/nokogiri/html/element_description_defaults.rb, line 61 def default_sub_element d = default_desc d ? d.defaultsubelt : nil end
Is this element deprecated?
# File lib/nokogiri/html/element_description_defaults.rb, line 47 def deprecated? d = default_desc d ? d.depr : nil end
A list of deprecated attributes for this element
# File lib/nokogiri/html/element_description_defaults.rb, line 75 def deprecated_attributes d = default_desc d ? d.attrs_depr : [] end
The description for this element
# File lib/nokogiri/html/element_description_defaults.rb, line 54 def description d = default_desc d ? d.desc : nil end
Is this an empty element?
static VALUE empty_eh(VALUE self)
{
htmlElemDesc * description;
Data_Get_Struct(self, htmlElemDesc, description);
if(description->empty) return Qtrue;
return Qfalse;
}
Can the end tag be implied for this tag?
# File lib/nokogiri/html/element_description_defaults.rb, line 33 def implied_end_tag? d = default_desc d ? d.endTag : nil end
Can the start tag be implied for this tag?
# File lib/nokogiri/html/element_description_defaults.rb, line 26 def implied_start_tag? d = default_desc d ? d.startTag : nil end
Is this element an inline element?
static VALUE inline_eh(VALUE self)
{
htmlElemDesc * description;
Data_Get_Struct(self, htmlElemDesc, description);
if(description->isinline) return Qtrue;
return Qfalse;
}
Inspection information
# File lib/nokogiri/html/element_description.rb, line 18 def inspect "#<#{self.class.name}: #{name} #{description}>" end
Get the tag name for this ElemementDescription
static VALUE name(VALUE self)
{
htmlElemDesc * description;
Data_Get_Struct(self, htmlElemDesc, description);
if(NULL == description->name) return Qnil;
return NOKOGIRI_STR_NEW2(description->name);
}
A list of optional attributes for this element
# File lib/nokogiri/html/element_description_defaults.rb, line 68 def optional_attributes d = default_desc d ? d.attrs_opt : [] end
A list of required attributes for this element
# File lib/nokogiri/html/element_description_defaults.rb, line 82 def required_attributes d = default_desc d ? d.attrs_req : [] end
Should the end tag be saved?
# File lib/nokogiri/html/element_description_defaults.rb, line 40 def save_end_tag? d = default_desc d ? d.saveEndTag : nil end
A list of allowed sub elements for this element.
static VALUE sub_elements(VALUE self)
{
htmlElemDesc * description;
VALUE list;
int i;
Data_Get_Struct(self, htmlElemDesc, description);
list = rb_ary_new();
if(NULL == description->subelts) return list;
for(i = 0; description->subelts[i]; i++) {
rb_ary_push(list, NOKOGIRI_STR_NEW2(description->subelts[i]));
}
return list;
}
Generated with the Darkfish Rdoc Generator 2.