Class: Pdf::Label::Speedee

Inherits:
BaseService
  • Object
show all
Includes:
Base
Defined in:
app/services/pdf/label/speedee.rb

Overview

Service object: speedee.

Defined Under Namespace

Classes: Result

Constant Summary collapse

LOGO_PATH =

Filesystem/URL path for logo.

Rails.root.join("data/images/spee-dee-logo-316x318.png").to_s.freeze
PAGE_W =

Label: 4 in wide × 6 in tall (portrait)

(4.0 * 72)
PAGE_H =

432 pt

(6.0 * 72)

Constants included from Base

Base::FONT, Base::NIMBUS_SANS_PATH, Base::NIMBUS_SANS_PATH_BOLD, Base::WY_LOGO_PATH

Instance Method Summary collapse

Instance Method Details

#call(shipment, options = {}) ⇒ Object



17
18
19
20
21
# File 'app/services/pdf/label/speedee.rb', line 17

def call(shipment, options = {})
  Pdf::Loader.load!
  pdf = generate(shipment, options)
  Result.new(pdf: pdf, shipment: shipment, file_name: "#{shipment.reference_number}.pdf")
end