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
static VALUE get_description(VALUE klass, VALUE tag_name) { const htmlElemDesc * description = htmlTagLookup( (const xmlChar *)StringValueCStr(tag_name) ); if(NULL == description) return Qnil; return Data_Wrap_Struct(klass, 0, 0, (void *)(uintptr_t)description); }
Get ElemementDescription for tag_name
# File lib/nokogiri/html/element_description.rb, line 6 def block? !inline? end
Is this element a block element?
static VALUE default_sub_element(VALUE self) { const htmlElemDesc * description; Data_Get_Struct(self, htmlElemDesc, description); if (description->defaultsubelt) return NOKOGIRI_STR_NEW2(description->defaultsubelt); return Qnil; }
The default sub element for this element
static VALUE deprecated_eh(VALUE self) { const htmlElemDesc * description; Data_Get_Struct(self, htmlElemDesc, description); if(description->depr) return Qtrue; return Qfalse; }
Is this element deprecated?
static VALUE deprecated_attributes(VALUE self) { const htmlElemDesc * description; VALUE list; int i; Data_Get_Struct(self, htmlElemDesc, description); list = rb_ary_new(); if(NULL == description->attrs_depr) return list; for(i = 0; description->attrs_depr[i]; i++) { rb_ary_push(list, NOKOGIRI_STR_NEW2(description->attrs_depr[i])); } return list; }
A list of deprecated attributes for this element
static VALUE description(VALUE self) { const htmlElemDesc * description; Data_Get_Struct(self, htmlElemDesc, description); return NOKOGIRI_STR_NEW2(description->desc); }
The description for this element
static VALUE empty_eh(VALUE self) { const htmlElemDesc * description; Data_Get_Struct(self, htmlElemDesc, description); if(description->empty) return Qtrue; return Qfalse; }
Is this an empty element?
static VALUE implied_end_tag_eh(VALUE self) { const htmlElemDesc * description; Data_Get_Struct(self, htmlElemDesc, description); if(description->endTag) return Qtrue; return Qfalse; }
Can the end tag be implied for this tag?
static VALUE implied_start_tag_eh(VALUE self) { const htmlElemDesc * description; Data_Get_Struct(self, htmlElemDesc, description); if(description->startTag) return Qtrue; return Qfalse; }
Can the start tag be implied for this tag?
static VALUE inline_eh(VALUE self) { const htmlElemDesc * description; Data_Get_Struct(self, htmlElemDesc, description); if(description->isinline) return Qtrue; return Qfalse; }
Is this element an inline element?
# File lib/nokogiri/html/element_description.rb, line 18 def inspect "#<#{self.class.name}: #{name} #{description}>" end
Inspection information
static VALUE name(VALUE self) { const htmlElemDesc * description; Data_Get_Struct(self, htmlElemDesc, description); if(NULL == description->name) return Qnil; return NOKOGIRI_STR_NEW2(description->name); }
Get the tag name for this ElemementDescription
static VALUE optional_attributes(VALUE self) { const htmlElemDesc * description; VALUE list; int i; Data_Get_Struct(self, htmlElemDesc, description); list = rb_ary_new(); if(NULL == description->attrs_opt) return list; for(i = 0; description->attrs_opt[i]; i++) { rb_ary_push(list, NOKOGIRI_STR_NEW2(description->attrs_opt[i])); } return list; }
A list of optional attributes for this element
static VALUE required_attributes(VALUE self) { const htmlElemDesc * description; VALUE list; int i; Data_Get_Struct(self, htmlElemDesc, description); list = rb_ary_new(); if(NULL == description->attrs_req) return list; for(i = 0; description->attrs_depr[i]; i++) { rb_ary_push(list, NOKOGIRI_STR_NEW2(description->attrs_req[i])); } return list; }
A list of required attributes for this element
static VALUE save_end_tag_eh(VALUE self) { const htmlElemDesc * description; Data_Get_Struct(self, htmlElemDesc, description); if(description->saveEndTag) return Qtrue; return Qfalse; }
Should the end tag be saved?
static VALUE sub_elements(VALUE self) { const 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; }
A list of allowed sub elements for this element.
# File lib/nokogiri/html/element_description.rb, line 12 def to_s "#{name}: #{description}" end
Convert this description to a string
© 2008–2018 Aaron Patterson, Mike Dalessio, Charles Nutter, Sergio Arbeo,
Patrick Mahoney, Yoko Harada, Akinori MUSHA, John Shahid, Lars Kanis
Licensed under the MIT License.