dbc-ruby 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,18 +1,60 @@
1
- #DBC Ruby
1
+ #DBC API Ruby Client
2
2
 
3
3
  ## Installation
4
4
 
5
5
  If you want to use the Dev Bootcamp (DBC) Ruby gem, run:
6
6
 
7
- gem install --source https://someurl
8
-
9
- ## Requirements
7
+ gem install dbc-ruby
10
8
 
11
- * Ruby 1.9.3
12
- * rest-client
9
+ ## Configuration
13
10
 
14
- ## Development
11
+ You must have an api key to make api requests with this gem.
12
+ You can see your api key by logging in at [dev.devbootcamp.com](http://dev.devbootcamp.com)
15
13
 
16
- Run unit test with:
14
+ Set your DBC_API environment variable to your api key, or use the gem to configure your key:
15
+ ```ruby
16
+ DBC::token = # your api key
17
+ ```
18
+ For making requests between DBC shared applications, you must also congifure the shared key.
19
+ Set your DBC_SHARED environment variable to the shared key, or use the gem:
20
+ ```ruby
21
+ DBC::shared_token = # the shared token
22
+ ```
17
23
 
18
- bundle exec rake test
24
+ ## Methods
25
+
26
+ ### User
27
+
28
+ Class methods:
29
+
30
+ ```ruby
31
+ DBC::User.all() # => all users
32
+ DBC::User.all(page: 1, per_page: 10) # => first 10 users
33
+ DBC::User.find(id) # => a specific user by user_id
34
+ ```
35
+
36
+ Instance methods:
37
+
38
+ ```ruby
39
+ user.cohort # => a specific user's cohort object
40
+ user.challenge_attempts # => a user's challenge attempts
41
+ user.exercise_attempts # => a user's exercies attempts
42
+ ```
43
+
44
+ ### Cohort
45
+
46
+ Class methods:
47
+
48
+ ```ruby
49
+ DBC::Cohort.all() # => all cohorts
50
+ DBC::Cohort.all(page: 1, per_page: 10) # => first 10 cohorts
51
+ DBC::Cohort.find(id) # => a specific cohort by user_id
52
+ ```
53
+
54
+ ### Challenge
55
+
56
+ ### ChallengeAttempt
57
+
58
+ ### Exercise
59
+
60
+ ### ExerciseAttempt
@@ -1,3 +1,3 @@
1
1
  module DBC
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
data/lib/dbc-ruby.rb CHANGED
@@ -1,4 +1,4 @@
1
- require_relative 'dbc/dbc_object'
1
+ require_relative 'dbc/dbc_object'
2
2
  require_relative 'dbc/user'
3
3
  require_relative 'dbc/cohort'
4
4
  require_relative 'dbc/challenge'
@@ -11,7 +11,7 @@ require 'json'
11
11
  require 'rest_client'
12
12
 
13
13
  module DBC
14
- @api_url = 'https://api.devbootcamp.com'
14
+ @api_url = 'https://api.devbootcamp.com/v1'
15
15
  @token = nil
16
16
  @shared_token = nil
17
17
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbc-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: