The TextConstruct module is used to define a Text construct Atom element, which is used to store small quantities of human-readable text
The TextConstruct has a type attribute, e.g. text, html, xhtml
Methods
Attributes
[W] | xhtml |
Class Public methods
append_features(klass)
Link
# File lib/rss/atom.rb, line 98 def self.append_features(klass) super klass.class_eval do [ ["type", ""], ].each do |name, uri, required| install_get_attribute(name, uri, required, :text_type) end content_setup add_need_initialize_variable("xhtml") class << self def xml_getter "xhtml" end def xml_setter "xhtml=" end end end end
Instance Public methods
atom_validate(ignore_unknown_element, tags, uri)
Link
# File lib/rss/atom.rb, line 142 def atom_validate(ignore_unknown_element, tags, uri) if have_xml_content? if @xhtml.nil? raise MissingTagError.new("div", tag_name) end unless [@xhtml.name, @xhtml.uri] == ["div", XHTML_URI] raise NotExpectedTagError.new(@xhtml.name, @xhtml.uri, tag_name) end end end
have_xml_content?()
Link
Returns true if type is “xhtml”
xhtml()
Link
# File lib/rss/atom.rb, line 124 def xhtml return @xhtml if @xhtml.nil? if @xhtml.is_a?(XML::Element) and [@xhtml.name, @xhtml.uri] == ["div", XHTML_URI] return @xhtml end children = @xhtml children = [children] unless children.is_a?(Array) XML::Element.new("div", nil, XHTML_URI, {"xmlns" => XHTML_URI}, children) end
xml_getter()
Link