In Files

  • rss/maker/base.rb

Class/Module Index [+]

Quicksearch

RSS::Maker::AtomTextConstructBase::EnsureXMLContent

Public Instance Methods

ensure_xml_content(content) click to toggle source
 
               # File rss/maker/base.rb, line 308
def ensure_xml_content(content)
  xhtml_uri = ::RSS::Atom::XHTML_URI
  unless content.is_a?(RSS::XML::Element) and
      ["div", xhtml_uri] == [content.name, content.uri]
    children = content
    children = [children] unless content.is_a?(Array)
    children = set_xhtml_uri_as_default_uri(children)
    content = RSS::XML::Element.new("div", nil, xhtml_uri,
                                    {"xmlns" => xhtml_uri},
                                    children)
  end
  content
end
            
included(base) click to toggle source
 
               # File rss/maker/base.rb, line 294
def included(base)
  super
  base.class_eval do
    %w(type content xml_content).each do |element|
      attr_reader element
      attr_writer element if element != "xml_content"
      add_need_initialize_variable(element)
    end

    alias_method(:xhtml, :xml_content)
  end
end
            
xhtml=(content) click to toggle source
 
               # File rss/maker/base.rb, line 326
def xhtml=(content)
  self.xml_content = content
end
            
xml_content=(content) click to toggle source
 
               # File rss/maker/base.rb, line 322
def xml_content=(content)
  @xml_content = ensure_xml_content(content)
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus