I'm trying to create and initialize an instance of
print "Enter address for HTTP request: "
URL = gets.chomp
HTTPClient = Net::HTTP.new(URL, 80)
You've stored an instance of the class
Net::HTTP in your
HTTPClient constant. But
get_print isn't an instance method of
Net::HTTP (see the docs), it's a singleton method of the class object
Net::HTTP itself. Therefore, you cannot call
get_print on an instance.
Here's how you might use
require 'net/http' Net::HTTP.get_print('www.google.com', '/')