class OPML

Public Class Methods

new(title = nil) click to toggle source
# File bin/podcatcher, line 2122
def initialize(title = nil)
        @doc = Document.new
        @doc.xml_decl.dowrite
        @doc.add_element Element.new("opml")
        @doc.root.add_attribute "version", "1.1"
        head = Element.new("head")
        @doc.root.add_element head
        if title
                titlee = Element.new("title")
                titlee.text = title
                head.add_element titlee
        end
        @body = Element.new("body")
        @doc.root.add_element @body
        @size = 0
end

Public Instance Methods

add(feedurl, text=nil) click to toggle source
# File bin/podcatcher, line 2138
def add(feedurl, text=nil)
        e = Element.new("outline")
        e.add_attribute("text", text) if text
        e.add_attribute "type", "link"
        e.add_attribute "url", feedurl
        @body.add_element e
        @size += 1
end
size() click to toggle source
# File bin/podcatcher, line 2149
def size()
        @size
end
write() click to toggle source
# File bin/podcatcher, line 2146
def write()
        @doc.write $stdout, 0
end