uboost-client 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +22 -7
- data/lib/uboost-client/version.rb +1 -1
- data/spec/simple_test.rb +1 -0
- metadata +2 -2
data/README.markdown
CHANGED
@@ -14,19 +14,29 @@ gem install 'uboost-client'
|
|
14
14
|
require 'uboost-client'
|
15
15
|
|
16
16
|
client = UboostClient::Client.new(:subdomain => 'test_subdomain', :api_credentials =>
|
17
|
-
{:username => 'api_username', password => 'api_password'})
|
17
|
+
{:username => 'api_username', :password => 'api_password'})
|
18
18
|
|
19
19
|
# Examples
|
20
20
|
#
|
21
21
|
# All commands return a OpenStruct. Its structure correlates to the
|
22
22
|
# JSON that is returned from uBoost API.
|
23
23
|
|
24
|
-
client.account.create({ "user_name" => "test_user_2" })
|
25
|
-
=>
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
24
|
+
response = client.account.create({ "user_name" => "test_user_2" })
|
25
|
+
=>
|
26
|
+
<OpenStruct student={"id"=>921679358,
|
27
|
+
"external_id"=>nil,
|
28
|
+
"catalog_id"=>109,
|
29
|
+
"points"=>0, ...}
|
30
|
+
|
31
|
+
response.student[:points]
|
32
|
+
=> 0
|
33
|
+
|
34
|
+
or if there is any error:
|
35
|
+
|
36
|
+
response.status
|
37
|
+
=> 422
|
38
|
+
response.message
|
39
|
+
=> "Widgets API requires a student account"
|
30
40
|
|
31
41
|
client.account.select(921679358)
|
32
42
|
|
@@ -51,4 +61,9 @@ client.badges.award(921679359, 1)
|
|
51
61
|
client.badges.unaward(921679359, 1)
|
52
62
|
|
53
63
|
client.widgets.profile(921679358)
|
64
|
+
|
65
|
+
client.widgets.my_badges(921679358)
|
66
|
+
|
67
|
+
client.widgets.ubar(921679358)
|
68
|
+
|
54
69
|
```
|
data/spec/simple_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uboost-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|