Class: EarthTools::Lookup::Base
- Inherits:
-
Object
- Object
- EarthTools::Lookup::Base
- Defined in:
- lib/earth_tools/lookup/base.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#search(*options) ⇒ EarthTools::Result?
Query the Earth Tools service and return a EarthTools::Result object.
Instance Method Details
#search(*options) ⇒ EarthTools::Result?
Query the Earth Tools service and return a EarthTools::Result object.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/earth_tools/lookup/base.rb', line 16 def search(*) begin Timeout::timeout(EarthTools::Configuration.timeout) do raw_results = retrieve(query()) parse_results(raw_results, :xml) end rescue Timeout::Error => err raise_error(err) or warn "Earth Tools API took too long to respond. See EarthTools::Configuration to set the timeout time (currently set to #{EarthTools::Configuration.timeout} seconds)." end end |