README.md in fedex_location_service-0.2.0 vs README.md in fedex_location_service-0.3.0

- old
+ new

@@ -40,11 +40,11 @@ * address_two * city * state * postal_code -This can be done with a Struct or with active_record address model. This can then be passed to FedexLocationService::Message.build() to generate the proper SOAP message. +This can be done with a Struct or with active_record model. This can then be passed to FedexLocationService::Message.build() to generate the proper SOAP message. Example: ```ruby Address = Struct.new(:address_one, :address_two, :city, :state, :postal_code) @@ -60,10 +60,20 @@ response = FedexLocationService::Request.call(message) ``` This will return a Savon::Response object that you can parse. +The FedEx Location Service API will return a status of 'SUCCESS' if locations have been found for the address provided in the message. + +The FedEx Location Service API will return a status of 'ERROR' if no locations have been found for the address provided in the message. + +The method will rescue from any Savon::SOAPFault exception and return a hash that consists of: + +* :cause +* :code +* :desc + Included is a FedexLocationService::Locations.call() method that will extract the first 5 closest locations and return the addresses, distance and a map image. ```ruby locations = FedexLocationService::Locations.call(response) @@ -78,18 +88,20 @@ :distance => "0.275", :map_url => "https://maps.googleapis.com/maps/api/staticmap?size=350x350&zoom=15&markers=color:blue%7Clabel:A%7C37.59091,-77.50386&maptype=roadmap&sensor=false" } ``` +For convenience there are both production and test .wsdl files located in the the spec/doc directory for the version of the FedEx Web Services Location Service version (currently Version 7) that this gem is tested against. + ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/odin/location_service. +Bug reports and pull requests are welcome on GitHub at https://github.com/odin/fedex_location_service/issues. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).