class SlackMessaging::RandomMessage

Public Class Methods

acquire_random_quote() click to toggle source
# File lib/slack_messaging/random_message.rb, line 5
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']
  quote_author = JSON.parse(random_quote)['author']
  "\"#{quote_content}\"\n—#{quote_author}"
end