Class Syndication::Atom::Content
In: lib/syndication/atom.rb
Parent: Syndication::Atom::Data

XML or text content

Methods

new   store   tag_end   tag_start   text  

Attributes

xml  [RW] 

Public Class methods

[Source]

# File lib/syndication/atom.rb, line 219
    def initialize(parent, tag = nil, attrs = nil)
      @xml = ""
      super
    end

Public Instance methods

[Source]

# File lib/syndication/atom.rb, line 224
    def store(tag, obj)
      #puts "[obj:#{tag}]"
    end

[Source]

# File lib/syndication/atom.rb, line 244
    def tag_end(endtag, current)
      if @tag == endtag
        return @parent
      end
      @xml += "</#{endtag}>"
      return self
    end

[Source]

# File lib/syndication/atom.rb, line 228
    def tag_start(tag, attrs = nil)
      #puts "[tag:#{tag}]"
      attrlist = ""
      if attrs
        for a in attrs.keys
          if attrlist != ""
            attrlist += " "
          end
          attrlist += "#{a}=\"#{attrs[a]}\""
        end
        @xml += "<#{tag} #{attrlist}>"
      else
        @xml += "<#{tag}>"
      end
    end

[Source]

# File lib/syndication/atom.rb, line 252
    def text(s)
      #puts "[text:#{s}]"
      @xml += s
    end

[Validate]