module Northwestern

Constants

BASE_URL
VERSION

Public Class Methods

course_details(params={}) click to toggle source
# File lib/northwestern-api.rb, line 29
def course_details(params={})
  self.get('/courses/details', params)
end
courses(params={}) click to toggle source
# File lib/northwestern-api.rb, line 25
def courses(params={})
  self.get('/courses', params)
end
get(path, params) click to toggle source
# File lib/northwestern-api.rb, line 45
def get(path, params)
  if defined? Northwestern::API_KEY
    uri = URI(BASE_URL)
    uri.path = path
    uri.query = URI.encode_www_form(params.merge(
      { key: Northwestern::API_KEY }
    ))

    JSON.parse(Net::HTTP.get(uri))
  else
    "Please set your API key (see readme)"
  end
end
instructors(params={}) click to toggle source
# File lib/northwestern-api.rb, line 33
def instructors(params={})
  self.get('/instructors', params)
end
room_details(params={}) click to toggle source
# File lib/northwestern-api.rb, line 41
def room_details(params={})
  self.get('/rooms/details', params)
end
rooms(params={}) click to toggle source
# File lib/northwestern-api.rb, line 37
def rooms(params={})
  self.get('/rooms', params)
end
schools(params={}) click to toggle source
# File lib/northwestern-api.rb, line 13
def schools(params={})
  self.get('/schools', {})
end
subjects(params={}) click to toggle source
# File lib/northwestern-api.rb, line 21
def subjects(params={})
  self.get('/subjects', params)
end
terms(params={}) click to toggle source
# File lib/northwestern-api.rb, line 9
def terms(params={})
  self.get('/terms', {})
end