Class: FriendlyShipping::Services::TForceFreight::GenerateDocumentOptionsHash

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

Overview

Generates a document options hash for JSON serialization.

Class Method Summary collapse

Class Method Details

.call(document_options:) ⇒ Hash

Returns document options hash suitable for JSON request.

Parameters:

Returns:

  • (Hash)

    document options hash suitable for JSON request



11
12
13
14
15
16
17
# File 'lib/friendly_shipping/services/tforce_freight/generate_document_options_hash.rb', line 11

def call(document_options:)
  {
    type: document_options.document_type_code,
    format: document_options.format_code,
    label: label(document_options)
  }.compact
end