From 83059431c58e196944758dd518a6fa5bde8679fa Mon Sep 17 00:00:00 2001 From: Tibor Szolar Date: Tue, 27 May 2014 17:13:45 +0200 Subject: [PATCH] Readme fixes. --- README.md | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 56bb4a6..f3c8313 100644 --- a/README.md +++ b/README.md @@ -30,28 +30,47 @@ Or install it yourself as: ## Basic usage +```ruby + # Creates a new instance of client with OAuth2 credentials client = KOSapiClient.new(OAUTH_CLIENT_ID, OAUTH_SECRET) - + # Retrieves first page of all course events course_events_page = client.course_events course_events_page.each { |event| do_stuff_with_event(event) } - + # Fetches page of parallels according to API parameters parallels_page = client.parallels.offset(0).limit(50).query('course.department' => '18*') - + # Finds all parallels related to parallel with id = 42 client.parallels.find(42).related +``` - ## Contributing