Class: EasyPost::Pickup
- Inherits:
-
Resource
- Object
- EasyPostObject
- Resource
- EasyPost::Pickup
- Defined in:
- lib/easypost/pickup.rb
Instance Attribute Summary
Attributes inherited from EasyPostObject
#api_key, #name, #parent, #unsaved_values
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Resource
class_name, create, #delete, #refresh, retrieve, #save, url, #url
Methods inherited from EasyPostObject
#[], #[]=, #as_json, construct_from, #deconstruct_keys, #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
.all(filters = {}, api_key = nil) ⇒ Object
23 24 25 |
# File 'lib/easypost/pickup.rb', line 23 def self.all(filters={}, api_key=nil) raise NotImplementedError.new('Pickup.all not implemented.') end |
Instance Method Details
#buy(params = {}) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/easypost/pickup.rb', line 2 def buy(params={}) if params.instance_of?(EasyPost::PickupRate) temp = params.clone params = {} params[:carrier] = temp.carrier params[:service] = temp.service end response = EasyPost.make_request(:post, url + '/buy', @api_key, params) self.refresh_from(response, @api_key, true) return self end |
#cancel(params = {}) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/easypost/pickup.rb', line 16 def cancel(params={}) response = EasyPost.make_request(:post, url + '/cancel', @api_key, params) self.refresh_from(response, @api_key, true) return self end |