Skip to content

Conversation

@dora1405
Copy link

slack.rb

Congratulations! You're submitting your assignment!

You and your partner should collaborate on the answers to these questions.

Comprehension Questions

Question Answer
How did you go about exploring the Slack API? Did you learn anything that would be useful for your next project involving an API? Reading through the Slack API documentation helped us navigate through the API calls. Will help in navigating future API documentations.
Give a short summary of the request/response cycle. Where does your program fit into that scheme? The computer sends the query/request to the API and API returns the answer/response back to the computer.
How does your program check for and handle errors when using the Slack API? Our program doesn't yet but it can. It currently only raise an NotImplementError within the program.
Did you need to make any changes to the design work we did in class? If so, what were they? We did not use detail methods within the User and Channel classes, and used show_details for all details.
Did you use any of the inheritance idioms we've talked about in class? How? We used the self.list in recipient to have the user and channel children classes to list their contents.
How does VCR aid in testing a program that uses an API? VCR caches the information provided by the API so that there are not multiple calls to the API for the same information during testing.

dora1405 and others added 30 commits September 9, 2019 20:52
@jmaddox19
Copy link

slack.rb

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene (no slack tokens) X
Comprehension questions X
Functionality
List users/channels Yes, but no tests directly on the users and channels attributes. - not a big deal :)
Select user/channel X
Show details X
Send message X
Program runs without crashing Yes, though there were a few times I selected a user then tried send a message and the "Enter the message you would like to send:" prompt didn't show up.
Implementation
API errors are handled appropriately No, there is no API error handling. Definitely something to improve upon.
Inheritance model matches in-class activity Somewhat. The attributes are inherited and the "self.get" method, but the "send_message" method is not utilized.
Inheritance idioms (abstract class, template methods, polymorphism) used appropriately Somewhat. The send_message is written in the workspace class, which is an inappropriate delegation of responsibility. The details method doesn't actually show details like it's intended to. If it did show details on channels and users, it would be similarly inappropriate for it to live in the Workspace class.
Methods are used to break work down into simpler tasks Yes, but there wasn't much of that needed here because the logic in the code itself isn't very complex. I will continue to look out for this in future submissions to make sure more complex logic is broken down into methods effectively.
Class and instance methods are used appropriately Yes
Tests written for User functionality Yes
Tests written for Channel Functionality Yes
Tests written for sending a message Yes
Overall The code is definitely approaching what we're looking for and it's clear that y'all learned a lot in doing this project :) There's is area for growth is setting up relationships between classes, especially as it relates to inheritance and in writing error-handling for API calls.


# Source Citation: lines 20-23 & 27 with Paige and Angele
def self.list
channels = self.get("https://slack.com/api/conversations.list")["channels"]

Choose a reason for hiding this comment

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

There should be error handling here, reading the response code and returning an instance of SlackApiError.


def self.list

response = self.get("https://slack.com/api/users.list")["members"]

Choose a reason for hiding this comment

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

There should be error handling here, reading the response code and returning an instance of SlackApiError.




def show_details

Choose a reason for hiding this comment

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

I want to talk with y'all to understand why y'all chose to put this and send_message here rather than in the Recipient, User, and Channel like the design prescribes.

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