class FunnyTerminal::Quote
Public Class Methods
print(json)
click to toggle source
# File lib/funny_terminal/quote.rb, line 16 def self.print(json) quote = json["quote"] puts quote["message"] puts quote["author"] Catpix::print_image_url quote["image"] end
request()
click to toggle source
# File lib/funny_terminal/quote.rb, line 7 def self.request url = API_SERVER + "quotes/random" uri = URI(url) response = Net::HTTP.get(uri) json = JSON.parse(response) print(json) end