Class: Singly::Http

Inherits:
Object
  • Object
show all
Extended by:
Logger
Defined in:
lib/singly/http.rb

Class Method Summary collapse

Methods included from Logger

log

Class Method Details

.base_urlObject



6
7
8
# File 'lib/singly/http.rb', line 6

def base_url
  "https://api.singly.com/#{Singly.version}"
end

.fetch(path, options = {}) ⇒ Object



10
11
12
13
14
15
# File 'lib/singly/http.rb', line 10

def fetch(path, options={})
  log("#{path} with #{options}")
  response = Typhoeus::Request.new("#{base_url}#{path}", options).run
  validate_response(response)
  parse_response(response)
end