Sha256: bee64189e4e0e98df25132e33f66acb921fb7f91e8c50229eeea1dd3e0a98006

Contents?: true

Size: 411 Bytes

Versions: 10

Compression:

Stored size: 411 Bytes

Contents

# frozen_string_literal: true

module SlackMessaging
  class RandomMessage
    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
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
slack_messaging-3.3.0 lib/slack_messaging/random_message.rb
slack_messaging-3.2.3 lib/slack_messaging/random_message.rb
slack_messaging-3.2.2 lib/slack_messaging/random_message.rb
slack_messaging-3.2.1 lib/slack_messaging/random_message.rb
slack_messaging-3.2.0 lib/slack_messaging/random_message.rb
slack_messaging-3.1.3 lib/slack_messaging/random_message.rb
slack_messaging-3.1.2 lib/slack_messaging/random_message.rb
slack_messaging-3.1.1 lib/slack_messaging/random_message.rb
slack_messaging-3.1.0 lib/slack_messaging/random_message.rb
slack_messaging-3.0.0 lib/slack_messaging/random_message.rb