Sha256: 4d7f924d51b6a796d8b2ae8997d85746386a6142bfec9eccb00c52b0b166b8ac

Contents?: true

Size: 614 Bytes

Versions: 17

Compression:

Stored size: 614 Bytes

Contents

module EasyPost
  class Pickup < Resource

    def buy(params={})
      if params.instance_of?(EasyPost::PickupRate)
        temp = params.clone
        params = {}
        params[:carrier] = temp.carrier
        params[:service] = temp.service
      end

      response, api_key = EasyPost.request(:post, url + '/buy', @api_key, params)
      self.refresh_from(response, @api_key, true)

      return self
    end

    def cancel(params={})
      response, api_key = EasyPost.request(:post, url + '/cancel', @api_key, params)
      self.refresh_from(response, @api_key, true)

      return self
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
easypost-3.0.1 lib/easypost/pickup.rb
easypost-3.0.0 lib/easypost/pickup.rb
easypost-2.7.3 lib/easypost/pickup.rb
easypost-2.7.2 lib/easypost/pickup.rb
easypost-2.7.1 lib/easypost/pickup.rb
easypost-2.7.0 lib/easypost/pickup.rb
easypost-2.6.2 lib/easypost/pickup.rb
easypost-2.6.1 lib/easypost/pickup.rb
easypost-2.6.0 lib/easypost/pickup.rb
easypost-2.5.0 lib/easypost/pickup.rb
easypost-2.4.0 lib/easypost/pickup.rb
easypost-2.3.0 lib/easypost/pickup.rb
easypost-2.2.0 lib/easypost/pickup.rb
easypost-2.1.11 lib/easypost/pickup.rb
easypost-2.1.10 lib/easypost/pickup.rb
easypost-2.1.9 lib/easypost/pickup.rb
easypost-2.1.8 lib/easypost/pickup.rb