Sha256: 11bd81f0eb4db932073f6c2efb38aba138b4f29bd08824f437a4934b44fb2846

Contents?: true

Size: 587 Bytes

Versions: 21

Compression:

Stored size: 587 Bytes

Contents

module EasyPost
  class Printer < Resource

    def job
      response, api_key = EasyPost.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, api_key = EasyPost.request(
        :post, url + '/print_postage_label', @api_key, params
      )
      return true
    rescue
      return false
    end

  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

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