Method: CatGenerator::Fact.next

Defined in:
lib/cat_generator/fact.rb

.nextObject



7
8
9
10
11
12
13
14
# 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