Class: XML::Feed::Parser::Rss
- Defined in:
- lib/xml/libxml/feed/parsers/rss.rb
Defined Under Namespace
Modules: Common Classes: Channel, Item
Instance Attribute Summary
Attributes inherited from Base
#doc, #validated, #version, #xml
Instance Method Summary collapse
- #channel ⇒ Object
-
#initialize(version, io, auto_validate = true) ⇒ Rss
constructor
A new instance of Rss.
- #validate! ⇒ Object
Constructor Details
#initialize(version, io, auto_validate = true) ⇒ Rss
Returns a new instance of Rss.
8 9 10 |
# File 'lib/xml/libxml/feed/parsers/rss.rb', line 8 def initialize(version, io, auto_validate=true) super end |
Instance Method Details
#channel ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/xml/libxml/feed/parsers/rss.rb', line 23 def channel channels = [] @doc.find('/rss/channel').each do |x| channels.push(Channel.new(x)) end return channels end |
#validate! ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/xml/libxml/feed/parsers/rss.rb', line 12 def validate! case @version when '2.0' validate_20 else validation_error "Validating RSS version #{@version} is not supported (yet!)" end @validated = true end |