private Method

Parser.to_uri(rss)

Attempt to convert rss to a URI, but just return it if there’s a ::URI::Error

Source Code

# File rss/parser.rb, line 117
def to_uri(rss)
  return rss if rss.is_a?(::URI::Generic)

  begin
    URI(rss)
  rescue ::URI::Error
    rss
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.