Class: Kobra::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/kobra/client.rb

Defined Under Namespace

Classes: AuthError, BadResponse, NotFound, ServerError

Instance Method Summary collapse

Constructor Details

#initialize(settings = {}) ⇒ Client

Kobra::Client.new(:domain => “kobra.ks.liu.se”, :username => “john”, :api_key => “a3h93hu393”)



14
15
16
17
# File 'lib/kobra/client.rb', line 14

def initialize(settings = {})
  settings[:domain] ||= 'kobra.ks.liu.se'
  @base_url = "https://#{settings[:username]}:#{settings[:api_key]}@#{settings[:domain]}/"
end

Instance Method Details

#get_student(parameters) ⇒ Object

get_student(:liu_id => ‘johec890’) Parameters: liu_id, email, personal_number, rfid_number, barcode_number



21
22
23
# File 'lib/kobra/client.rb', line 21

def get_student(parameters)
  json_post('students/api.json', parameters)
end