-
Notifications
You must be signed in to change notification settings - Fork 26
Leaves - Kristina & Ga-Young #8
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
base: master
Are you sure you want to change the base?
Conversation
…me, Slack ID to the console.
…responding tests.
…s. Updated slack.rb. Wave 2 Completed.
… posted message to channel. Passed corresponding tests.
… channel name or channel id.
…. Passed corresponding tests. Wave 3 complete.
slack.rbWhat We're Looking For
One of the key learning goals for this project was implementing a design using inheritance. I have left an inline comment demonstrating one place where using inheritance would have resulted in a less dependent design. Let's talk about the benefits of template methods and inheritance at our next one on one. |
|
|
||
| puts prompt | ||
|
|
||
| while command = gets.chomp.downcase |
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.
Consider using helper methods to encapsulate some of the functionality in this CLI.
| return result | ||
| end | ||
|
|
||
| def search(data_source, query_term) |
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.
This code is very similar to select a user and select a channel. Could you DRY this up somehow?
| return HTTParty.get(url, query: query_parameters) | ||
| end | ||
|
|
||
| def user_list |
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.
What you've done here works. Nice work! However, the recommendation to put this method in the user class was there to reduce dependencies between classes. When you instantiate a new User below, this means that Workspace needs to know everything about User. This is a perfect situation for a class method.
| query_parameters = { | ||
| token: ENV['SLACK_TOKEN'] | ||
| } | ||
| return HTTParty.get(url, query: query_parameters) |
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.
Make sure you handle bad requests appropriately.
| @@ -0,0 +1,238 @@ | |||
| require_relative 'test_helper' | |||
|
|
|||
| describe "Workspace" do | |||
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.
Thorough tests. Nice work!
| puts options | ||
| while selected_command = gets.chomp.downcase | ||
| case selected_command | ||
| when "main menu" |
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.
Consider adding the options "show details" and "send message" to the main menu so that user of the CLI can send a second message to an already selected recipient.
| else | ||
| puts "Invalid input. Returning to main menu..." | ||
| puts prompt | ||
| break |
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.
Consider allowing users to re-enter their input rather than breaking the program when the user input is invalid.
slack.rb
Congratulations! You're submitting your assignment!
You and your partner should collaborate on the answers to these questions.
Comprehension Questions