Sha256: 20b6ddd680ada3a02bc813c4554eea0876fd08617236bdfa38c4cbcd277f6b62
Contents?: true
Size: 702 Bytes
Versions: 3
Compression:
Stored size: 702 Bytes
Contents
# frozen_string_literal: true module FriendlyShipping module Services class TForceFreight # Generates a location hash for JSON serialization. class GenerateLocationHash class << self # @param location [Physical::Location] the location # @return [Hash] location hash suitable for JSON request def call(location:) { address: { city: location.city, stateProvinceCode: location.region&.code, postalCode: location.zip&.strip&.[](0..4), country: location.country&.code }.compact } end end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems