Class: FMS::HTTPClient
- Inherits:
-
Object
- Object
- FMS::HTTPClient
- Defined in:
- lib/fms/client.rb
Instance Method Summary collapse
- #get(url, timeout) ⇒ Object
-
#initialize(host, port) ⇒ HTTPClient
constructor
A new instance of HTTPClient.
Constructor Details
#initialize(host, port) ⇒ HTTPClient
Returns a new instance of HTTPClient.
60 61 62 63 |
# File 'lib/fms/client.rb', line 60 def initialize(host, port) @host = host @port = port end |
Instance Method Details
#get(url, timeout) ⇒ Object
65 66 67 68 69 70 71 72 |
# File 'lib/fms/client.rb', line 65 def get(url, timeout) http = Net::HTTP.new @host, @port unless timeout.nil? http.read_timeout = timeout http.open_timeout = timeout end http.request Net::HTTP::Get.new(url) end |