Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Add attribute reader for carrier tracking url #133

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

leobossmann
Copy link
Contributor

The carrier tracking url is generated but is inaccessible on the Shipment Object. This commit provides a fix.

The carrier tracking url is generated but is inaccessible on the
Shipment Object. This commit provides a fix.
lib/shipcloud/shipment.rb Outdated Show resolved Hide resolved
Fix for line too long error
@codeclimate
Copy link

codeclimate bot commented Jun 13, 2023

Code Climate has analyzed commit c779213 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 99.2% (0.0% change).

View more on Code Climate.

@stphnrdmr stphnrdmr self-assigned this Jun 13, 2023
Copy link
Contributor

@stphnrdmr stphnrdmr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @leobossmann, thank you for your contribution!

I've added two necessary changes below, once those are fixed we can get this PR merged and released so you can use the new attribute in your application.

Let me know if you need any help or if there are any questions.

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be moved to the Unreleased header, we'll move it to a new version header (probably 0.13.0) before the change is released.

@@ -9,7 +9,8 @@ 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,
:packages, :price, :customs_declaration, :pickup, :label_voucher_url
:packages, :price, :customs_declaration, :pickup,
:label_voucher_url, :carrier_tracking_url
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a corresponding spec file at spec/shipcloud/shipment_spec.rb, could you add a spec for this new attribute?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants