From e53520215c0d0bcf2aaab6f9dfa3a5493e92f1ce Mon Sep 17 00:00:00 2001 From: Leo Bossmann <797656+leobossmann@users.noreply.github.com> Date: Tue, 13 Jun 2023 12:02:52 +0200 Subject: [PATCH 1/2] Add attribute reader for carrier tracking url The carrier tracking url is generated but is inaccessible on the Shipment Object. This commit provides a fix. --- CHANGELOG.md | 1 + lib/shipcloud/shipment.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5576549..1490edf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - Add attr_accessor for `additional_services` to class `Shipcloud::Shipment` to be able to access the additional_services attribute at the shipment object. - Add attr_reader for `label_voucher_url` to class `Shipcloud::Shipment` to be able to read the label_voucher_url (QR Code url) attribute at the shipment object. - Added missing `frozen_string_literal: true` magic comments to files +- Add attr_reader for `carrier_tracking_url` to class `Shipcloud::Shipment` to be able to read the carrier_tracking_url attribute at the shipment object. ### Changed - Ensure compatibility with ruby 2.x and 3.x diff --git a/lib/shipcloud/shipment.rb b/lib/shipcloud/shipment.rb index 105ac3e..d6c0413 100644 --- a/lib/shipcloud/shipment.rb +++ b/lib/shipcloud/shipment.rb @@ -8,7 +8,7 @@ class Shipment < Base attr_accessor :from, :to, :carrier, :service, :package, :reference_number, :metadata, :additional_services - attr_reader :id, :created_at, :carrier_tracking_no, :tracking_url, :label_url, + attr_reader :id, :created_at, :carrier_tracking_no, :tracking_url, :label_url, :carrier_tracking_url, :packages, :price, :customs_declaration, :pickup, :label_voucher_url def self.index_response_root From c7792136e32765e48a30890d092fa5d61ca6fee3 Mon Sep 17 00:00:00 2001 From: Leo Bossmann <797656+leobossmann@users.noreply.github.com> Date: Tue, 13 Jun 2023 12:10:58 +0200 Subject: [PATCH 2/2] Code style changes Fix for line too long error --- lib/shipcloud/shipment.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/shipcloud/shipment.rb b/lib/shipcloud/shipment.rb index d6c0413..2e150fd 100644 --- a/lib/shipcloud/shipment.rb +++ b/lib/shipcloud/shipment.rb @@ -8,8 +8,9 @@ class Shipment < Base attr_accessor :from, :to, :carrier, :service, :package, :reference_number, :metadata, :additional_services - attr_reader :id, :created_at, :carrier_tracking_no, :tracking_url, :label_url, :carrier_tracking_url, - :packages, :price, :customs_declaration, :pickup, :label_voucher_url + attr_reader :id, :created_at, :carrier_tracking_no, :tracking_url, :label_url, + :packages, :price, :customs_declaration, :pickup, + :label_voucher_url, :carrier_tracking_url def self.index_response_root "#{class_name.downcase}s"