Skip to content
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

Add my solution to both problems #121

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

Conversation

JeffMorhous
Copy link

No description provided.

@@ -1,13 +1,34 @@
def get_letter_grade(integer)

#Put your code here!
if integer >= 90 then

Choose a reason for hiding this comment

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

Awesome work! There are some styling things going on here so I wanted to link the style guide for reference: https://github.com/rubocop-hq/ruby-style-guide

Using ' single tick quotes when you aren't interpolating.
Don't need to explicitlty call return to return values, ruby will evaluate the last line of the method as is and return it.

Functionality wise here this work but does it seem like it's starting to get a little lengthy? If you have a hunch you are correct, check out case statements and also you can have the final catch in your if/elsif/else be an else instead of the return outside of the if statement

letsdrill.rb Outdated
shortest = array[0]

array.each { |item|
if item.length < shortest.length then

Choose a reason for hiding this comment

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

Pretty creative way to solve it! You do not need the then here.

letsdrill.rb Outdated

shortest = array[0]

array.each { |item|

Choose a reason for hiding this comment

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

It's preferred to use the do/end syntax for multiline blocks

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for all the tips! I swapped out all the styling stuff like you mentioned 👍

Copy link

@djlax805 djlax805 left a comment

Choose a reason for hiding this comment

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

Looks great, change up some styling and you have a nice solution on your hands

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

Successfully merging this pull request may close these issues.

2 participants