class HttpFind::Response

Attributes

body[R]
code[R]

Public Class Methods

new(uri) click to toggle source
# File lib/http_find/response.rb, line 8
def initialize(uri)
  furi = uri.start_with?("http") ? uri : "http://#{uri}"
  party = HTTParty.get(furi)
  @code = party.response.code.to_i
  @body = @code == 200 ? party.response.body : nil
end