Skip to content

Get delivery by ID#6

Merged
nicogaldamez merged 3 commits intomainfrom
feature/get-delivery
Feb 19, 2025
Merged

Get delivery by ID#6
nicogaldamez merged 3 commits intomainfrom
feature/get-delivery

Conversation

@nicogaldamez
Copy link
Member

Why

Users need to retrieve a Delivery by ID from the Uber Direct API.

What

  • Introduced the Request object, which simplifies making API requests.
    • It handles connection, authorization, etc.
    • The Client object is no longer needed, so I removed it.
    • URLs can include placeholders (e.g., :customer_id), which the Request object replaces with the corresponding value.
  • Created DeliveryResource, which serves as the interface for interacting with delivery objects in the Uber API.

@nicogaldamez nicogaldamez added the enhancement New feature or request label Feb 18, 2025
@nicogaldamez nicogaldamez self-assigned this Feb 18, 2025
class DeliveryResource
class << self
def find(id)
response = Request.new("customers/:customer_id/deliveries/#{id}").get
Copy link
Contributor

Choose a reason for hiding this comment

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

¿No es mejor acá directamente usar el customer_id que hacer gsub en otro lado?

Copy link
Member Author

Choose a reason for hiding this comment

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

Dale, lo cambio

stub_delivery_request
delivery = Ruber::DeliveryResource.find("del_some_id")

assert_equal Ruber::Delivery, delivery.class
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assert_equal Ruber::Delivery, delivery.class
assert_instance_of Ruber::Delivery, delivery

Copy link
Contributor

@bruno-costanzo bruno-costanzo left a comment

Choose a reason for hiding this comment

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

excelente!

@nicogaldamez nicogaldamez merged commit 27ed0fe into main Feb 19, 2025
1 check passed
@nicogaldamez nicogaldamez deleted the feature/get-delivery branch February 19, 2025 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants