Class: SlackMessaging::RandomMessage
- Inherits:
-
Object
- Object
- SlackMessaging::RandomMessage
- Defined in:
- lib/slack_messaging/random_message.rb
Class Method Summary collapse
Class Method Details
.acquire_random_quote ⇒ Object
3 4 5 6 7 8 |
# File 'lib/slack_messaging/random_message.rb', line 3 def self.acquire_random_quote random_quote = HTTParty.get('http://api.quotable.io/random', headers: { 'Content-Type': 'application/json' }).body quote_content = JSON.parse(random_quote)['content'] = JSON.parse(random_quote)['author'] return "\"#{quote_content}\"" + "\n" + "—#{}" end |