class FriendlyShipping::Services::UpsFreight::LabelDocumentOptions
Constants
- DOCUMENT_FORMATS
- DOCUMENT_TYPES
- THERMAL_CODE
Attributes
format[R]
length[R]
thermal[R]
type[R]
width[R]
Public Class Methods
new( format: :pdf, type: :label, size: "4x6", thermal: false, labels_per_page: 1 )
click to toggle source
# File lib/friendly_shipping/services/ups_freight/label_document_options.rb, line 24 def initialize( format: :pdf, type: :label, size: "4x6", thermal: false, labels_per_page: 1 ) @format = format @type = type @length, @width = size.split('x').sort @thermal = thermal @labels_per_page = labels_per_page end
Public Instance Methods
document_type_code()
click to toggle source
# File lib/friendly_shipping/services/ups_freight/label_document_options.rb, line 42 def document_type_code DOCUMENT_TYPES.fetch(type) end
format_code()
click to toggle source
# File lib/friendly_shipping/services/ups_freight/label_document_options.rb, line 38 def format_code DOCUMENT_FORMATS.fetch(format) end
labels_per_page()
click to toggle source
# File lib/friendly_shipping/services/ups_freight/label_document_options.rb, line 50 def labels_per_page @labels_per_page.to_s end
thermal_code()
click to toggle source
# File lib/friendly_shipping/services/ups_freight/label_document_options.rb, line 46 def thermal_code THERMAL_CODE.fetch(thermal) end