Skip to content

Commit

Permalink
Add YARD docs to UPS Freight classes
Browse files Browse the repository at this point in the history
  • Loading branch information
pelargir committed Mar 20, 2024
1 parent 3671573 commit c50e4ee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/friendly_shipping/services/ups_freight.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def carriers

# Get rates for a shipment
# @param [Physical::Shipment] shipment The shipment we want to get rates for
# @param [FriendlyShipping::Services::UpsFreight::RatesOptions] options Options for obtaining rates for this shipment.
# @param [RatesOptions] options Options for obtaining rates for this shipment.
# @return [Result<ApiResult<Array<Rate>>>] The rates returned from UPS encoded in a
# `FriendlyShipping::ApiResult` object.
def rate_estimates(shipment, options:, debug: false)
Expand All @@ -72,7 +72,7 @@ def rate_estimates(shipment, options:, debug: false)

# Get labels for a shipment
# @param [Physical::Shipment] shipment The shipment we want to get rates for
# @param [FriendlyShipping::Services::UpsFreight::LabelOptions] options Options for shipping this shipment.
# @param [LabelOptions] options Options for shipping this shipment.
# @return [Result<ApiResult<ShipmentInformation>] The information that you need for shipping this shipment.
def labels(shipment, options:, debug: false)
freight_ship_request_hash = GenerateFreightShipRequestHash.call(shipment: shipment, options: options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class UpsFreight
class GenerateHandlingUnitsHash
class << self
# @param [Physical::Shipment] shipment
# @param [FriendlyShipping::ShipmentOptions] options
# @param [ShipmentOptions] options
# @return [Hash]
def call(shipment:, options:)
handling_units(shipment, options).reduce(&:merge)
Expand All @@ -15,7 +15,7 @@ def call(shipment:, options:)
private

# @param [Physical::Shipment] shipment
# @param [FriendlyShipping::ShipmentOptions] options
# @param [ShipmentOptions] options
# @return [Array<Hash>]
def handling_units(shipment, options)
all_package_options = shipment.packages.map { |package| options.options_for_package(package) }
Expand All @@ -24,7 +24,7 @@ def handling_units(shipment, options)
end.map { |package_options, quantity| handling_unit_hash(package_options, quantity) }
end

# @param [FriendlyShipping::PackageOptions] package_options
# @param [PackageOptions] package_options
# @param [Integer] quantity
# @return [Hash]
def handling_unit_hash(package_options, quantity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class UpsFreight
# @attribute [Physical::Location] billing_address The billing address
# @attribute [String] shipper_number The shipper number associated with the shipper
# @attribute [String] customer_context A reference to match this request with an order or shipment
# @attribute [FriendlyShipping::ShippingMethod] shipping_method The shipping method to use
# @attribute [ShippingMethod] shipping_method The shipping method to use
# @attribute [Callable] commodity_information_generator A callable that takes a shipment
# and an options object to create an Array of commodity fields as per the UPS docs.
# @attribute [Symbol] billing One of the keys in the `BILLING_CODES` constant. How the shipment
Expand Down

0 comments on commit c50e4ee

Please sign in to comment.