Class: HttpClient

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/cadbury/helpers/http_client.rb

Class Method Summary collapse

Class Method Details

.pretty_print(response) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/cadbury/helpers/http_client.rb', line 24

def self.pretty_print(response)
  puts Global::DIVIDER
  puts response.request.uri
  puts Global::DIVIDER
  puts "#{response.code} #{response.message}"
  puts Global::DIVIDER
  puts response.body
  puts Global::DIVIDER
end

.send_get_requestObject



16
17
18
19
20
21
22
# File 'lib/cadbury/helpers/http_client.rb', line 16

def self.send_get_request
  Whirly.start do
    Whirly.status = "Loading..."
    response = HttpClient.get(ARGV[1])
    HttpClient.pretty_print(response)
  end
end