Readme.md in fedex-2.0.1 vs Readme.md in fedex-2.2.0

- old
+ new

@@ -114,11 +114,11 @@ @total_freight_discounts=nil, @total_net_freight="32.1", @rate_zone="51"> ``` -### ** Generate a shipping label(PDF) ** +### ** Generate a shipping label (PDF) ** To create a label for a shipment: ```ruby label = fedex.label(:filename => "my_dir/example.pdf", @@ -127,13 +127,89 @@ :packages => packages, :service_type => "FEDEX_GROUND", :shipping_details => shipping_details) ``` -The label will be saved to the file system as the filename you specify and is Adobe PDF format. -Note that you can currently print a label for a single package at a time. +### ** Generate a shipping label in any available format ** +Change the filename extension and pass a label_specification hash. For example: + +```ruby +example_spec = { + :image_type => "EPL2", + :label_stock_type => "STOCK_4X6" +} + +label = fedex.label(:filename => "my_dir/example_epl2.pcx", + :shipper=>shipper, + :recipient => recipient, + :packages => packages, + :service_type => "FEDEX_GROUND", + :shipping_details => shipping_details, + :label_specification => example_spec) +``` + +### ** Tracking a shipment ** + +To track a shipment: + +```ruby +tracking_info = fedex.track(:tracking_number => "1234567890123") + +tracking_info.tracking_number +# => "1234567890123" + +tracking_info.status +# => "Delivered" + +tracking_info.events.first.description +# => "On FedEx vehicle for delivery" +``` + +### ** Tracking a shipment ** + +To track a shipment: + +```ruby +tracking_info = fedex.track(:tracking_number => "1234567890123") + +tracking_info.tracking_number +# => "1234567890123" + +tracking_info.status +# => "Delivered" + +tracking_info.events.first.description +# => "On FedEx vehicle for delivery" +``` + +### ** Verifying an address ** + +To verify an address is valid and deliverable: + +```ruby + +address = { + :street => "5 Elm Street", + :city => "Norwalk", + :state => "CT", + :postal_code => "06850", + :country => "USA" +} + +address_result = fedex.validate_address(:address => address) + +address_result.residential +# => true + +address_result.score +# => 100 + +address_result.postal_code +# => "06850-3901" +``` + # Services/Options Available ```ruby Fedex::Shipment::SERVICE_TYPES Fedex::Shipment::PACKAGING_TYPES @@ -141,9 +217,11 @@ ```` # Contributors: - [jazminschroeder](http://github.com/jazminschroeder) (Jazmin Schroeder) - [parndt](https://github.com/parndt) (Philip Arndt) +- [mmell](https://github.com/mmell) (Michael Mell) +- [jordanbyron](https://github.com/jordanbyron) (Jordan Byron) # Copyright/License: Copyright 2011 [Jazmin Schroeder](http://jazminschroeder.com) This gem is made available under the MIT license.