-
Notifications
You must be signed in to change notification settings - Fork 26
Leaves - Hallie/Yitgop - Slack-CLI #18
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
Co-authored-by: rinostar <codingrinostar@gmail.com>
Co-authored-by: rinostar <codingrinostar@gmail.com>
Co-authored-by: rinostar <codingrinostar@gmail.com>
slack.rbWhat We're Looking For
|
| private | ||
|
|
||
| def details | ||
| raise NotImplementedError, 'Implement me in a child class!' |
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.
Nice!
| end | ||
|
|
||
| def self.get(url) | ||
| response = HTTParty.get(url, query: {token: ENV["SLACK_TOKEN"]}) |
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.
I like that this is at a low level of the program rather than being passed around
| end | ||
|
|
||
| def self.list | ||
| response = Channel.get("https://slack.com/api/conversations.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.
I'd put this URL in a variable, just for clarity's sake. I'm being picky.
slack.rb
Congratulations! You're submitting your assignment!
You and your partner should collaborate on the answers to these questions.
Comprehension Questions
send_messagein the Recipient class. Slack.rb gathers a message from the user (text) that is passed as an argument inworkspace.send_messagewhere a selected recipient (user/channel instance) is stored in an instance variable.workspace.send_messagecallsrecipient.send_messagewith the parameters of message and slack_id (from the selected recipient instance stored there) and executes the request.