class NOAA_SOAP
Attributes
client[R]
Public Class Methods
most_recent(data)
click to toggle source
# File lib/noaa_soap.rb, line 6 def self.most_recent(data) d = data.sort { |x,y| y[:time_stamp] <=> x[:time_stamp] }[0] d end
new(wsdl = "https://opendap.co-ops.nos.noaa.gov/axis/webservices/waterlevelrawsixmin/wsdl/WaterLevelRawSixMin.wsdl")
click to toggle source
# File lib/noaa_soap.rb, line 11 def initialize(wsdl = "https://opendap.co-ops.nos.noaa.gov/axis/webservices/waterlevelrawsixmin/wsdl/WaterLevelRawSixMin.wsdl") create_client(wsdl) end
Public Instance Methods
pull_response(operation, message)
click to toggle source
# File lib/noaa_soap.rb, line 15 def pull_response(operation, message) response = self.client.call(operation, message: message) response rescue Savon::SOAPFault => error fault_code = error.to_hash[:fault][:faultcode] raise CustomError, fault_code end
Private Instance Methods
create_client(wsdl)
click to toggle source
# File lib/noaa_soap.rb, line 24 def create_client(wsdl) client = Savon.client(wsdl: wsdl, \ open_timeout: 30, \ read_timeout: 30, \ log: false, \ follow_redirects: true) @client = client self.client end