Extended maintenance of Ruby versions 1.8.7 and 1.9.2 will end on July 31, 2014. Read more

In Files

  • rss/parser.rb

Class/Module Index [+]

Quicksearch

RSS::Parser

Public Class Methods

new(rss, parser_class=self.class.default_parser) click to toggle source
 
               # File rss/parser.rb, line 88
def initialize(rss, parser_class=self.class.default_parser)
  @parser = parser_class.new(normalize_rss(rss))
end
            

Public Instance Methods

default_parser() click to toggle source
 
               # File rss/parser.rb, line 60
def default_parser
  @@default_parser || AVAILABLE_PARSERS.first
end
            
default_parser=(new_value) click to toggle source

Set @@default_parser to new_value if it is one of the available parsers. Else raise NotValidXMLParser error.

 
               # File rss/parser.rb, line 66
def default_parser=(new_value)
  if AVAILABLE_PARSERS.include?(new_value)
    @@default_parser = new_value
  else
    raise NotValidXMLParser.new(new_value)
  end
end
            
parse(rss, do_validate=true, ignore_unknown_element=true, parser_class=default_parser) click to toggle source
 
               # File rss/parser.rb, line 74
def parse(rss, do_validate=true, ignore_unknown_element=true,
          parser_class=default_parser)
  parser = new(rss, parser_class)
  parser.do_validate = do_validate
  parser.ignore_unknown_element = ignore_unknown_element
  parser.parse
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