Class | Amrita::TagInfo |
In: |
lib/amrita/tag.rb
|
Parent: | Object |
This class provide information for formatting.
DefaultTagInfo | = | TagInfoItem.new(nil).freeze |
# File lib/amrita/tag.rb, line 173 def accept_child?(element, name) raise TypeError if !element.is_a?(Element) taginfo = get_tag_info(element.tagname_symbol) taginfo.tag = (taginfo.tag_class || Tag).new(element.tagname) if !taginfo.tag return taginfo.tag.accept_child(name) end
# File lib/amrita/tag.rb, line 168 def empty_tag?(element) raise TypeError if !element.is_a?(Element) get_tag_info(element.tagname_symbol).empty_tag end
# File lib/amrita/tag.rb, line 152 def get_tag_info(tagname) case tagname when Symbol when String tagname = tagname.downcase.intern else raise TypeError end if @dict.has_key?(tagname) @dict[tagname] else @dict[tagname] = TagInfoItem.new(tagname) end end