Methods

LongURL::URL

Public Class Methods

check(url) click to toggle source

Check given url Raises LongURL::InvalidURL if url is invalid. Returns a parsed http uri object on success.

# File lib/longurl/url.rb, line 9
    def self.check(url)
      raise LongURL::InvalidURL if url.nil? or url.empty?
      result = URI.parse(url)
      raise LongURL::InvalidURL unless result.is_a?(URI::HTTP)
      result
    rescue URI::InvalidURIError
      raise LongURL::InvalidURL
    end

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.