Class: FriendlyShipping::Services::TForceFreight::ShipmentDocument

Inherits:
Object
  • Object
show all
Defined in:
lib/friendly_shipping/services/tforce_freight/shipment_document.rb

Overview

A shipping document (BOL, label, etc.) returned by the API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document_type:, document_format:, binary:, status: nil) ⇒ ShipmentDocument

Returns a new instance of ShipmentDocument.

Parameters:

  • document_type (String)

    the type of document

  • document_format (String)

    the format of the document

  • binary (String)

    the document's binary data

  • status (String) (defaults to: nil)

    the status of the document (defaults to nil)



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/friendly_shipping/services/tforce_freight/shipment_document.rb', line 24

def initialize(
  document_type:,
  document_format:,
  binary:,
  status: nil
)
  @document_type = document_type
  @document_format = document_format
  @binary = binary
  @status = status
end

Instance Attribute Details

#binaryString (readonly)

Returns the document's binary data.

Returns:

  • (String)

    the document's binary data



15
16
17
# File 'lib/friendly_shipping/services/tforce_freight/shipment_document.rb', line 15

def binary
  @binary
end

#document_formatString (readonly)

Returns the format of the document.

Returns:

  • (String)

    the format of the document



12
13
14
# File 'lib/friendly_shipping/services/tforce_freight/shipment_document.rb', line 12

def document_format
  @document_format
end

#document_typeString (readonly)

Returns the type of document.

Returns:

  • (String)

    the type of document



9
10
11
# File 'lib/friendly_shipping/services/tforce_freight/shipment_document.rb', line 9

def document_type
  @document_type
end

#statusString (readonly)

Returns the status of the document.

Returns:

  • (String)

    the status of the document



18
19
20
# File 'lib/friendly_shipping/services/tforce_freight/shipment_document.rb', line 18

def status
  @status
end