[ANN] Shipping for Ruby

L

Lucas Carlson

Shipping is a module that connects APIs for various shippers like UPS
and FedEx. It is available as a ruby gem:

gem install shipping

or from rubyforge

http://rubyforge.org/projects/shipping

There is going to be some data that will persist for all shipments. For
example, you will not want to repeat the fedex account number every
time in your implementation code. To set default values, setup a file
called .shipping.yml in the home directory of the user who will be
using this library. An example file would be:

fedex_url: https://url/to/fedex/api
fedex_account: 1234556
fedex_meter: 387878

ups_account: 7B4F74E3075AEEFF
ups_user: username
ups_password: password

You can set as many default values as you would like in this file.

require 'shipping'

ups = Shipping::UPS.new :zip => 97202, :sender_zip => 10001,
:weight => 2
ups.price => 8.77
ups.valid_address? => false

ups.city = "Portland"
ups.valid_address? => true

Alternately, you can instantiate the base class and then see both UPS
and FedEx information.

ship = Shipping::Base.new :zip => 97202, :state => "OR",
:sender_zip => 10001, :weight => 2
ship.ups.price => 8.77
ship.fedex.price => 5.17

ship.city = "Portland"
ship.ups.valid_address? => true

I hope you enjoy this library,

-Lucas Carlson
http://tech.rufy.com/
 
J

Joe Van Dyk

Shipping is a module that connects APIs for various shippers like UPS
and FedEx. It is available as a ruby gem:

gem install shipping

or from rubyforge

http://rubyforge.org/projects/shipping

There is going to be some data that will persist for all shipments. For
example, you will not want to repeat the fedex account number every
time in your implementation code. To set default values, setup a file
called .shipping.yml in the home directory of the user who will be
using this library. An example file would be:

fedex_url: https://url/to/fedex/api
fedex_account: 1234556
fedex_meter: 387878

ups_account: 7B4F74E3075AEEFF
ups_user: username
ups_password: password

You can set as many default values as you would like in this file.

require 'shipping'

ups = Shipping::UPS.new :zip => 97202, :sender_zip => 10001,
:weight => 2
ups.price => 8.77
ups.valid_address? => false

ups.city = "Portland"
ups.valid_address? => true

Alternately, you can instantiate the base class and then see both UPS
and FedEx information.

ship = Shipping::Base.new :zip => 97202, :state => "OR",
:sender_zip => 10001, :weight => 2
ship.ups.price => 8.77
ship.fedex.price => 5.17

ship.city = "Portland"
ship.ups.valid_address? => true

I hope you enjoy this library,

-Lucas Carlson

Great! Does this include tracking?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top