Sha256: ca55b19e14c726ee82b3af7e592be49d24be3fa37e5eac97ba9797985c0275e7

Contents?: true

Size: 579 Bytes

Versions: 2

Compression:

Stored size: 579 Bytes

Contents

module EasyPost
  class Printer < Resource

    def job
      response = EasyPost.make_request(
        :get, url + '/jobs', @api_key
      )
      return EasyPost::Util::convert_to_easypost_object(response, api_key)
    end

    def print(params={})
      if params.instance_of?(EasyPost::PostageLabel)
        temp = params.clone
        params = {}
        params[:postage_label] = temp
      end

      response = EasyPost.make_request(
        :post, url + '/print_postage_label', @api_key, params
      )
      return true
    rescue
      return false
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
easypost-3.1.4 lib/easypost/printer.rb
easypost-3.1.3 lib/easypost/printer.rb