Sha256: e111eaffa346dc7e11e5e012da2a474ed5bd4ad21cd7aec08ac5d58dfa2669b3
Contents?: true
Size: 1.82 KB
Versions: 1
Compression:
Stored size: 1.82 KB
Contents
[](https://codeclimate.com/github/webionate/shipcloud-ruby) [](https://travis-ci.org/webionate/shipcloud-ruby) # shipcloud A Ruby wrapper for the shipcloud API ## Installation Add this line to your application's Gemfile: gem 'shipcloud' And then execute: $ bundle Or install it yourself as: $ gem install shipcloud ## Usage Before using the shipcloud API, you need to set the API access key: ``` Shipcloud.api_key = 'your-api-key-goes-here' ``` Since Version 0.4.0, you can also do this via a configuration block, e.g. in an initializer: ``` Shipcloud.configure do |config| config.api_key = 'your-api-key-goes-here' end ``` You can sign up for a developer account at *[shipcloud.io](http://www.shipcloud.io)* ### Create a new shipment To create a new Shipment on the shipclod platform, you need to provide the name of the carrier, to- and from-address, and the package dimensions. For details, see *[shipcloud API documentation on Shipments](http://docs.shipcloud.apiary.io/#shipmentresources)* ``` Shipcloud::Shipment.create( carrier: 'ups', from: from-address-params, to: to-address-params, package: package-params, create_shipping_label: true ) ``` `Shipment#create` will return shipping label and tracking information, encapsulated in a `Shipcloud::Shipment` object: ``` shipment = Shipcloud::Shipment.create(...) # parameters ommitted shipment.tracking_url # -> http://track.shipcloud.io/uzdgu22z3ed12 ``` ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
shipcloud-0.4.0 | README.md |