Class: EasyPost::Batch
- Inherits:
-
Resource
- Object
- EasyPostObject
- Resource
- EasyPost::Batch
- Defined in:
- lib/easypost/batch.rb
Instance Attribute Summary
Attributes inherited from EasyPostObject
Class Method Summary collapse
Instance Method Summary collapse
- #add_shipments(params = {}) ⇒ Object
- #label(params = {}) ⇒ Object
- #remove_shipments(params = {}) ⇒ Object
Methods inherited from Resource
all, class_name, create, #delete, #refresh, retrieve, #save, url, #url
Methods inherited from EasyPostObject
#[], #[]=, #as_json, construct_from, #each, #id, #id=, #initialize, #inspect, #keys, #refresh_from, #to_hash, #to_json, #to_s, #values
Constructor Details
This class inherits a constructor from EasyPost::EasyPostObject
Class Method Details
.create_and_buy(params = {}) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/easypost/batch.rb', line 4 def self.create_and_buy(params={}) wrapped_params = {} wrapped_params[self.class_name().to_sym] = params response, api_key = EasyPost.request(:post, url + '/create_and_buy', @api_key, wrapped_params) return Util.convert_to_easypost_object(response, api_key) end |
Instance Method Details
#add_shipments(params = {}) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/easypost/batch.rb', line 26 def add_shipments(params={}) response, api_key = EasyPost.request(:post, url + '/add_shipments', @api_key, params) self.refresh_from(response, @api_key, true) return self end |