Module | RSS::Atom::TextConstruct |
In: |
lib/rss/atom.rb
|
xhtml | [W] |
# File lib/rss/atom.rb, line 79 79: def self.append_features(klass) 80: super 81: klass.class_eval do 82: [ 83: ["type", ""], 84: ].each do |name, uri, required| 85: install_get_attribute(name, uri, required, :text_type) 86: end 87: 88: content_setup 89: add_need_initialize_variable("xhtml") 90: 91: class << self 92: def xml_getter 93: "xhtml" 94: end 95: 96: def xml_setter 97: "xhtml=" 98: end 99: end 100: end 101: end
# File lib/rss/atom.rb, line 121 121: def atom_validate(ignore_unknown_element, tags, uri) 122: if have_xml_content? 123: if @xhtml.nil? 124: raise MissingTagError.new("div", tag_name) 125: end 126: unless [@xhtml.name, @xhtml.uri] == ["div", XHTML_URI] 127: raise NotExpectedTagError.new(@xhtml.name, @xhtml.uri, tag_name) 128: end 129: end 130: end
# File lib/rss/atom.rb, line 104 104: def xhtml 105: return @xhtml if @xhtml.nil? 106: if @xhtml.is_a?(XML::Element) and 107: [@xhtml.name, @xhtml.uri] == ["div", XHTML_URI] 108: return @xhtml 109: end 110: 111: children = @xhtml 112: children = [children] unless children.is_a?(Array) 113: XML::Element.new("div", nil, XHTML_URI, 114: {"xmlns" => XHTML_URI}, children) 115: end
# File lib/rss/atom.rb, line 133 133: def maker_target(target) 134: target.__send__(self.class.name.split(/::/).last.downcase) {|x| x} 135: end