module Governator::HTTPClient
Module to mixin HTTP web content retrieval
Public Instance Methods
base_uri()
click to toggle source
# File lib/governator/http_client.rb, line 16 def base_uri @base_uri ||= 'https://www.nga.org' end
get_page_contents(path)
click to toggle source
# File lib/governator/http_client.rb, line 10 def get_page_contents(path) path = URI.parse(path) uri = path.relative? ? "#{base_uri}#{path}" : path open(uri, &:read) end