class EasyPost::Pickup

Public Class Methods

all(filters={}, api_key=nil) click to toggle source
# File lib/easypost/pickup.rb, line 23
def self.all(filters={}, api_key=nil)
  raise NotImplementedError.new('Pickup.all not implemented.')
end

Public Instance Methods

buy(params={}) click to toggle source
# 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={}) click to toggle source
# 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