Skip to content

List deliveries#7

Merged
nicogaldamez merged 2 commits intomainfrom
feature/list_deliveries
Feb 21, 2025
Merged

List deliveries#7
nicogaldamez merged 2 commits intomainfrom
feature/list_deliveries

Conversation

@nicogaldamez
Copy link
Member

@nicogaldamez nicogaldamez commented Feb 21, 2025

Why

Users need to retrieve the list of deliveries from the Uber Direct API.

What

  • Added Collection object to represent a list of objects retrieved from the API
  • Added the all method to DeliveryResource object

@nicogaldamez nicogaldamez added the enhancement New feature or request label Feb 21, 2025
@nicogaldamez nicogaldamez self-assigned this Feb 21, 2025
def all
response = Request.new("customers/#{Ruber.customer_id}/deliveries").get

Collection.from_response(response, type: Delivery)
Copy link
Contributor

Choose a reason for hiding this comment

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

No convendría directamente pasar el response.body dado que es lo único que se usa?

Copy link
Member Author

Choose a reason for hiding this comment

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

Lo pensé y no veo razón para no hacerlo. Lo cambio.

end

def initialize(data:, next_href:)
@data = data
Copy link
Contributor

Choose a reason for hiding this comment

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

No tengo nada contra que se llame data, pero por ahí podría llamarse list o objects

Copy link
Member Author

Choose a reason for hiding this comment

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

Los nombres son los que usa la API de Uber. Me pareció mejor mantenerlos.

Co-authored-by: bruno costanzo <82187643+bruno-costanzo@users.noreply.github.com>
@nicogaldamez nicogaldamez merged commit 195cae5 into main Feb 21, 2025
1 check passed
@nicogaldamez nicogaldamez deleted the feature/list_deliveries branch February 21, 2025 12:37
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