Class: XML::Feed::Builder::Rss

Inherits:
Object
  • Object
show all
Defined in:
lib/xml/libxml/feed/builders/rss.rb,
lib/xml/libxml/feed/builders/rss.rb

Defined Under Namespace

Classes: Channel, Channels, Item, Items

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version, parser = nil) ⇒ Rss

Returns a new instance of Rss.



117
118
119
120
121
122
# File 'lib/xml/libxml/feed/builders/rss.rb', line 117

def initialize(version, parser=nil)
    @version = version
    @parser  = parser

    build_document
end

Instance Attribute Details

#docObject

Returns the value of attribute doc.



115
116
117
# File 'lib/xml/libxml/feed/builders/rss.rb', line 115

def doc
  @doc
end

#versionObject

Returns the value of attribute version.



114
115
116
# File 'lib/xml/libxml/feed/builders/rss.rb', line 114

def version
  @version
end

Instance Method Details

#channelObject



128
129
130
# File 'lib/xml/libxml/feed/builders/rss.rb', line 128

def channel
    return Channels.new(@doc)
end

#to_xmlObject



124
125
126
# File 'lib/xml/libxml/feed/builders/rss.rb', line 124

def to_xml
    @doc.to_s
end