class CatGenerator::Fact

Constants

CAT_FACTS_API

Public Class Methods

next() click to toggle source
# File lib/cat_generator/fact.rb, line 7
def self.next
  response = Excon.get(CAT_FACTS_API)

  if response.status == 200
    json_response = JSON.parse(response.body)
    json_response["facts"].first
  end
end