Class: ThumbnailScraper::HttpReceiver

Inherits:
Object
  • Object
show all
Defined in:
lib/thumbnail_scraper/http_receiver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHttpReceiver

Returns a new instance of HttpReceiver.



8
9
10
# File 'lib/thumbnail_scraper/http_receiver.rb', line 8

def initialize
  @http_client = ::HTTPClient.new
end

Instance Attribute Details

#http_clientObject

Returns the value of attribute http_client.



6
7
8
# File 'lib/thumbnail_scraper/http_receiver.rb', line 6

def http_client
  @http_client
end

Instance Method Details

#receive_webpage(url) ⇒ Object



12
13
14
15
# File 'lib/thumbnail_scraper/http_receiver.rb', line 12

def receive_webpage(url)
  content = http_client.get_content(url)
  Webpage.new(url, content)
end