-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Becca and Tammy Shipping API #20
base: RTTH/master
Are you sure you want to change the base?
Conversation
So there are two empty files, |
@@ -0,0 +1,3 @@ | |||
# Place all the behaviors and hooks related to the matching controller here. | |||
# All this logic will automatically be available in application.js. | |||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get in the habit of deleting files you don't use. Rails can be really heavy and comes with a lot of features you won't need. Keep your workspace tidy & it can potentially speed up performance.
|
||
usps_response = usps.find_rates(origin, destination, package) | ||
usps_rates = usps_response.rates.sort_by(&:price).collect {|rate| [rate.service_name, rate.price, rate.delivery_date]} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 14-15 & 17-18 seem like copy pasta code (i.e. identical). Could this have been pulled out into its own method?
def collectRates(shipper, origin, destination package)
# returns sorted rates
end
Nice job! Your code is really clean, legible and your methods practice single responsibility (9/10 times; see my earlier comment). I was also really pleased with your tests. Phrasing the test names so they sound like proper sentences is exactly how RSpec was meant to be used & y'all follow the convention perfectly. 👍 |
We chose UPS and USPS. Right now, users of the bEtsy app can see shipping options (rates and estimated shipping if available). Currently working on localhost (but not on heroku). Shipping API app: https://quartzy-shipping.herokuapp.com/
Our version of bEtsy: https://shipping-quartzy.herokuapp.com/
Trello Board: https://trello.com/b/9DpQ4ypX/shipping-service-api
See Trello Board for bugs and future features. Submit a issue if you're interested in helping out!
Thank you for reading our code and for the helpful comments!