class Shelob::Resolver

Public Class Methods

new(url) click to toggle source
# File lib/resolver.rb, line 6
def initialize url
  @url = url
end

Public Instance Methods

resolve() click to toggle source
# File lib/resolver.rb, line 10
def resolve
  begin 
    uri = URI(@url)

    resp = Net::HTTP.get_response(uri)

    LinkResult.new uri.to_s, resp.code.to_i, resp.body
  rescue Exception => e
    LinkResult.new @url, 900, e.message
  end
end