In Files

  • rss/atom.rb

Class/Module Index [+]

Quicksearch

RSS::Atom::TextConstruct

Attributes

xhtml[W]

Public Class Methods

append_features(klass) click to toggle source
 
               # File rss/atom.rb, line 86
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
            

Public Instance Methods

atom_validate(ignore_unknown_element, tags, uri) click to toggle source
 
               # File rss/atom.rb, line 128
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?() click to toggle source
 
               # File rss/atom.rb, line 124
def have_xml_content?
  @type == "xhtml"
end
            
xhtml() click to toggle source
 
               # File rss/atom.rb, line 111
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() click to toggle source
 
               # File rss/atom.rb, line 99
def xml_getter
  "xhtml"
end
            
xml_setter() click to toggle source
 
               # File rss/atom.rb, line 103
def xml_setter
  "xhtml="
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