Class: Welements::HttpService

Inherits:
Object
  • Object
show all
Defined in:
lib/welements/http_service.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(http = Net::HTTP) ⇒ HttpService

Returns a new instance of HttpService.



3
4
5
# File 'lib/welements/http_service.rb', line 3

def initialize(http = Net::HTTP)
  @HTTP = http
end

Instance Method Details

#get_welements(lat, lng) ⇒ Object



7
8
9
# File 'lib/welements/http_service.rb', line 7

def get_welements(lat, lng)
  LibXML::XML::Document.string(@HTTP.get(URI.parse("http://graphical.weather.gov/xml/SOAP_server/ndfdXMLclient.php?whichClient=NDFDgen&lat=#{lat}&lon=#{lng}&product=time-series&Unit=m&maxt=maxt&mint=mint&temp=temp&qpf=qpf&pop12=pop12&snow=snow&dew=dew&wspd=wspd&wdir=wdir&sky=sky&wx=wx&waveh=waveh&rh=rh&appt=appt&dryfireo=dryfireo&ptornado=ptornado&phail=phail&wgust=wgust")))
end