bcx 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/.travis.yml +2 -0
- data/README.md +1 -1
- data/bcx.gemspec +2 -1
- data/docs/access.html +140 -0
- data/docs/authorization.html +147 -0
- data/docs/bcx.html +200 -0
- data/docs/comment.html +139 -0
- data/docs/configuration.html +137 -0
- data/docs/docco.css +76 -64
- data/docs/http.html +151 -0
- data/docs/oauth.html +144 -0
- data/docs/person.html +147 -0
- data/docs/project.html +154 -0
- data/docs/public/fonts/roboto-black.eot +0 -0
- data/docs/public/fonts/roboto-black.ttf +0 -0
- data/docs/public/fonts/roboto-black.woff +0 -0
- data/docs/response_error.html +153 -0
- data/docs/todo.html +148 -0
- data/docs/todolist.html +158 -0
- data/docs/version.html +125 -0
- data/lib/bcx/resources/comment.rb +26 -0
- data/lib/bcx/resources/project.rb +1 -0
- data/lib/bcx/resources/todo.rb +1 -0
- data/lib/bcx/resources/todolist.rb +1 -0
- data/lib/bcx/version.rb +1 -1
- data/lib/bcx.rb +1 -0
- data/lib/tasks/docs.rake +4 -2
- data/spec/bcx/comment_spec.rb +31 -0
- data/spec/cassettes/Bcx_Resources_Comment/DELETE_/projects/9634353/comments/297584179_json/should_delete_the_given_comment.yml +140 -0
- data/spec/cassettes/Bcx_Resources_Comment/POST_/projects/9634353/todolists/29123043/comments_json/should_create_a_new_todolist_comment.yml +114 -0
- data/spec/cassettes/Bcx_Resources_Comment/POST_/projects/9634353/todos/185137845/comments_json/should_create_a_new_todo_comment.yml +114 -0
- metadata +41 -30
- data/docs/lib/bcx/client/http.html +0 -144
- data/docs/lib/bcx/client/oauth.html +0 -146
- data/docs/lib/bcx/configuration.html +0 -80
- data/docs/lib/bcx/launchpad/oauth.html +0 -137
- data/docs/lib/bcx/resources/access.html +0 -133
- data/docs/lib/bcx/resources/authorization.html +0 -140
- data/docs/lib/bcx/resources/person.html +0 -140
- data/docs/lib/bcx/resources/project.html +0 -146
- data/docs/lib/bcx/resources/todo.html +0 -140
- data/docs/lib/bcx/resources/todolist.html +0 -150
- data/docs/lib/bcx/response_error.html +0 -96
- data/docs/lib/bcx/version.html +0 -68
- data/docs/lib/bcx.html +0 -192
- data/docs/public/fonts/novecento-bold.eot +0 -0
- data/docs/public/fonts/novecento-bold.ttf +0 -0
- data/docs/public/fonts/novecento-bold.woff +0 -0
@@ -1,146 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<title>project.rb</title>
|
6
|
-
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
7
|
-
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
8
|
-
<link rel="stylesheet" media="all" href="../../../docco.css" />
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<div id="container">
|
12
|
-
<div id="background"></div>
|
13
|
-
|
14
|
-
<ul id="jump_to">
|
15
|
-
<li>
|
16
|
-
<a class="large" href="javascript:void(0);">Jump To …</a>
|
17
|
-
<a class="small" href="javascript:void(0);">+</a>
|
18
|
-
<div id="jump_wrapper">
|
19
|
-
<div id="jump_page">
|
20
|
-
|
21
|
-
|
22
|
-
<a class="source" href="../../bcx.html">
|
23
|
-
lib/bcx.rb
|
24
|
-
</a>
|
25
|
-
|
26
|
-
|
27
|
-
<a class="source" href="../client/http.html">
|
28
|
-
lib/bcx/client/http.rb
|
29
|
-
</a>
|
30
|
-
|
31
|
-
|
32
|
-
<a class="source" href="../client/oauth.html">
|
33
|
-
lib/bcx/client/oauth.rb
|
34
|
-
</a>
|
35
|
-
|
36
|
-
|
37
|
-
<a class="source" href="../configuration.html">
|
38
|
-
lib/bcx/configuration.rb
|
39
|
-
</a>
|
40
|
-
|
41
|
-
|
42
|
-
<a class="source" href="../launchpad/oauth.html">
|
43
|
-
lib/bcx/launchpad/oauth.rb
|
44
|
-
</a>
|
45
|
-
|
46
|
-
|
47
|
-
<a class="source" href="access.html">
|
48
|
-
lib/bcx/resources/access.rb
|
49
|
-
</a>
|
50
|
-
|
51
|
-
|
52
|
-
<a class="source" href="authorization.html">
|
53
|
-
lib/bcx/resources/authorization.rb
|
54
|
-
</a>
|
55
|
-
|
56
|
-
|
57
|
-
<a class="source" href="person.html">
|
58
|
-
lib/bcx/resources/person.rb
|
59
|
-
</a>
|
60
|
-
|
61
|
-
|
62
|
-
<a class="source" href="project.html">
|
63
|
-
lib/bcx/resources/project.rb
|
64
|
-
</a>
|
65
|
-
|
66
|
-
|
67
|
-
<a class="source" href="todo.html">
|
68
|
-
lib/bcx/resources/todo.rb
|
69
|
-
</a>
|
70
|
-
|
71
|
-
|
72
|
-
<a class="source" href="todolist.html">
|
73
|
-
lib/bcx/resources/todolist.rb
|
74
|
-
</a>
|
75
|
-
|
76
|
-
|
77
|
-
<a class="source" href="../response_error.html">
|
78
|
-
lib/bcx/response_error.rb
|
79
|
-
</a>
|
80
|
-
|
81
|
-
|
82
|
-
<a class="source" href="../version.html">
|
83
|
-
lib/bcx/version.rb
|
84
|
-
</a>
|
85
|
-
|
86
|
-
</div>
|
87
|
-
</li>
|
88
|
-
</ul>
|
89
|
-
|
90
|
-
<ul class="sections">
|
91
|
-
|
92
|
-
<li id="title">
|
93
|
-
<div class="annotation">
|
94
|
-
<h1>project.rb</h1>
|
95
|
-
</div>
|
96
|
-
</li>
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
<li id="section-1">
|
101
|
-
<div class="annotation">
|
102
|
-
|
103
|
-
<div class="pilwrap for-h2">
|
104
|
-
<a class="pilcrow" href="#section-1">¶</a>
|
105
|
-
</div>
|
106
|
-
<h2>Projects</h2>
|
107
|
-
<p>Provides access to projects resoource and other nested resources</p>
|
108
|
-
<h4>Fetch all projects</h4>
|
109
|
-
<p><code>GET /projects.json</code></p>
|
110
|
-
<pre><code>client.projects!</code></pre>
|
111
|
-
<h4>Fetch archived projects</h4>
|
112
|
-
<p><code>GET /projects/archived.json</code></p>
|
113
|
-
<pre><code>clients.projects.archived!</code></pre>
|
114
|
-
<h4>Fetch single project with ID of 123</h4>
|
115
|
-
<p><code>GET /projects/123.json</code></p>
|
116
|
-
<pre><code>client.projects!(<span class="number">123</span>)</code></pre>
|
117
|
-
<h4>Create a project</h4>
|
118
|
-
<p><code>POST /projects.json</code></p>
|
119
|
-
<pre><code>client.projects.create!(<span class="symbol">name:</span> <span class="string">'Acme project'</span>, <span class="symbol">description:</span> <span class="string">'This is a new project'</span>)</code></pre>
|
120
|
-
<h4>Update an existing project</h4>
|
121
|
-
<p><code>PUT /projects/123.json</code></p>
|
122
|
-
<pre><code>client.projects(<span class="number">123</span>).update!(<span class="symbol">description:</span> <span class="string">'A new description'</span>)</code></pre>
|
123
|
-
<h4>Delete a project</h4>
|
124
|
-
<p><code>DELETE /projects/123.json</code></p>
|
125
|
-
<pre><code>client.projects(<span class="number">123</span>).delete!</code></pre>
|
126
|
-
|
127
|
-
</div>
|
128
|
-
|
129
|
-
<div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">module</span> <span class="title">Bcx</span></span>
|
130
|
-
<span class="class"><span class="keyword">module</span> <span class="title">Resources</span></span>
|
131
|
-
<span class="class"><span class="keyword">class</span> <span class="title">Project</span> <span class="inheritance">< <span class="parent">Rapidash::Base</span></span></span>
|
132
|
-
resource <span class="symbol">:todolists</span>
|
133
|
-
resource <span class="symbol">:todos</span>
|
134
|
-
resource <span class="symbol">:accesses</span>
|
135
|
-
|
136
|
-
collection <span class="symbol">:archived</span>
|
137
|
-
<span class="keyword">end</span>
|
138
|
-
<span class="keyword">end</span>
|
139
|
-
<span class="keyword">end</span></pre></div></div>
|
140
|
-
|
141
|
-
</li>
|
142
|
-
|
143
|
-
</ul>
|
144
|
-
</div>
|
145
|
-
</body>
|
146
|
-
</html>
|
@@ -1,140 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<title>todo.rb</title>
|
6
|
-
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
7
|
-
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
8
|
-
<link rel="stylesheet" media="all" href="../../../docco.css" />
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<div id="container">
|
12
|
-
<div id="background"></div>
|
13
|
-
|
14
|
-
<ul id="jump_to">
|
15
|
-
<li>
|
16
|
-
<a class="large" href="javascript:void(0);">Jump To …</a>
|
17
|
-
<a class="small" href="javascript:void(0);">+</a>
|
18
|
-
<div id="jump_wrapper">
|
19
|
-
<div id="jump_page">
|
20
|
-
|
21
|
-
|
22
|
-
<a class="source" href="../../bcx.html">
|
23
|
-
lib/bcx.rb
|
24
|
-
</a>
|
25
|
-
|
26
|
-
|
27
|
-
<a class="source" href="../client/http.html">
|
28
|
-
lib/bcx/client/http.rb
|
29
|
-
</a>
|
30
|
-
|
31
|
-
|
32
|
-
<a class="source" href="../client/oauth.html">
|
33
|
-
lib/bcx/client/oauth.rb
|
34
|
-
</a>
|
35
|
-
|
36
|
-
|
37
|
-
<a class="source" href="../configuration.html">
|
38
|
-
lib/bcx/configuration.rb
|
39
|
-
</a>
|
40
|
-
|
41
|
-
|
42
|
-
<a class="source" href="../launchpad/oauth.html">
|
43
|
-
lib/bcx/launchpad/oauth.rb
|
44
|
-
</a>
|
45
|
-
|
46
|
-
|
47
|
-
<a class="source" href="access.html">
|
48
|
-
lib/bcx/resources/access.rb
|
49
|
-
</a>
|
50
|
-
|
51
|
-
|
52
|
-
<a class="source" href="authorization.html">
|
53
|
-
lib/bcx/resources/authorization.rb
|
54
|
-
</a>
|
55
|
-
|
56
|
-
|
57
|
-
<a class="source" href="person.html">
|
58
|
-
lib/bcx/resources/person.rb
|
59
|
-
</a>
|
60
|
-
|
61
|
-
|
62
|
-
<a class="source" href="project.html">
|
63
|
-
lib/bcx/resources/project.rb
|
64
|
-
</a>
|
65
|
-
|
66
|
-
|
67
|
-
<a class="source" href="todo.html">
|
68
|
-
lib/bcx/resources/todo.rb
|
69
|
-
</a>
|
70
|
-
|
71
|
-
|
72
|
-
<a class="source" href="todolist.html">
|
73
|
-
lib/bcx/resources/todolist.rb
|
74
|
-
</a>
|
75
|
-
|
76
|
-
|
77
|
-
<a class="source" href="../response_error.html">
|
78
|
-
lib/bcx/response_error.rb
|
79
|
-
</a>
|
80
|
-
|
81
|
-
|
82
|
-
<a class="source" href="../version.html">
|
83
|
-
lib/bcx/version.rb
|
84
|
-
</a>
|
85
|
-
|
86
|
-
</div>
|
87
|
-
</li>
|
88
|
-
</ul>
|
89
|
-
|
90
|
-
<ul class="sections">
|
91
|
-
|
92
|
-
<li id="title">
|
93
|
-
<div class="annotation">
|
94
|
-
<h1>todo.rb</h1>
|
95
|
-
</div>
|
96
|
-
</li>
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
<li id="section-1">
|
101
|
-
<div class="annotation">
|
102
|
-
|
103
|
-
<div class="pilwrap for-h2">
|
104
|
-
<a class="pilcrow" href="#section-1">¶</a>
|
105
|
-
</div>
|
106
|
-
<h2>Todo</h2>
|
107
|
-
<p>Provides access to todolist resoource both at the client level and per-project</p>
|
108
|
-
<h4>Get todos for a todolist</h4>
|
109
|
-
<p><code>GET /todolists/1.json</code></p>
|
110
|
-
<pre><code>todolist = client.todolists!(<span class="number">1</span>)
|
111
|
-
todolist.todos.remaining
|
112
|
-
todolist.todos.completed</code></pre>
|
113
|
-
<h4>Get a specific todo</h4>
|
114
|
-
<p><code>GET /projects/1/todos/2.json</code></p>
|
115
|
-
<pre><code>client.projects(<span class="number">1</span>).todos!(<span class="number">2</span>)</code></pre>
|
116
|
-
<h4>Create a todo</h4>
|
117
|
-
<p><code>POST /projects/1/todolists/2/todos.json</code></p>
|
118
|
-
<pre><code>client.projects(<span class="number">1</span>).todolists(<span class="number">2</span>).todos.create!(<span class="symbol">content:</span> <span class="string">'Update copy text'</span>)</code></pre>
|
119
|
-
<h4>Update a todo</h4>
|
120
|
-
<p><code>PUT /projects/1/todos/2.json</code></p>
|
121
|
-
<pre><code>client.projects(<span class="number">1</span>).todos(<span class="number">2</span>).update!(<span class="symbol">completed:</span> <span class="keyword">true</span>)</code></pre>
|
122
|
-
<h4>Delete a todo</h4>
|
123
|
-
<p><code>DELETE /projects/1/todos/2.json</code></p>
|
124
|
-
<pre><code>client.projects(<span class="number">1</span>).todos(<span class="number">2</span>).delete!</code></pre>
|
125
|
-
|
126
|
-
</div>
|
127
|
-
|
128
|
-
<div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">module</span> <span class="title">Bcx</span></span>
|
129
|
-
<span class="class"><span class="keyword">module</span> <span class="title">Resources</span></span>
|
130
|
-
<span class="class"><span class="keyword">class</span> <span class="title">Todo</span> <span class="inheritance">< <span class="parent">Rapidash::Base</span></span></span>
|
131
|
-
<span class="keyword">end</span>
|
132
|
-
<span class="keyword">end</span>
|
133
|
-
<span class="keyword">end</span></pre></div></div>
|
134
|
-
|
135
|
-
</li>
|
136
|
-
|
137
|
-
</ul>
|
138
|
-
</div>
|
139
|
-
</body>
|
140
|
-
</html>
|
@@ -1,150 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<title>todolist.rb</title>
|
6
|
-
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
7
|
-
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
8
|
-
<link rel="stylesheet" media="all" href="../../../docco.css" />
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<div id="container">
|
12
|
-
<div id="background"></div>
|
13
|
-
|
14
|
-
<ul id="jump_to">
|
15
|
-
<li>
|
16
|
-
<a class="large" href="javascript:void(0);">Jump To …</a>
|
17
|
-
<a class="small" href="javascript:void(0);">+</a>
|
18
|
-
<div id="jump_wrapper">
|
19
|
-
<div id="jump_page">
|
20
|
-
|
21
|
-
|
22
|
-
<a class="source" href="../../bcx.html">
|
23
|
-
lib/bcx.rb
|
24
|
-
</a>
|
25
|
-
|
26
|
-
|
27
|
-
<a class="source" href="../client/http.html">
|
28
|
-
lib/bcx/client/http.rb
|
29
|
-
</a>
|
30
|
-
|
31
|
-
|
32
|
-
<a class="source" href="../client/oauth.html">
|
33
|
-
lib/bcx/client/oauth.rb
|
34
|
-
</a>
|
35
|
-
|
36
|
-
|
37
|
-
<a class="source" href="../configuration.html">
|
38
|
-
lib/bcx/configuration.rb
|
39
|
-
</a>
|
40
|
-
|
41
|
-
|
42
|
-
<a class="source" href="../launchpad/oauth.html">
|
43
|
-
lib/bcx/launchpad/oauth.rb
|
44
|
-
</a>
|
45
|
-
|
46
|
-
|
47
|
-
<a class="source" href="access.html">
|
48
|
-
lib/bcx/resources/access.rb
|
49
|
-
</a>
|
50
|
-
|
51
|
-
|
52
|
-
<a class="source" href="authorization.html">
|
53
|
-
lib/bcx/resources/authorization.rb
|
54
|
-
</a>
|
55
|
-
|
56
|
-
|
57
|
-
<a class="source" href="person.html">
|
58
|
-
lib/bcx/resources/person.rb
|
59
|
-
</a>
|
60
|
-
|
61
|
-
|
62
|
-
<a class="source" href="project.html">
|
63
|
-
lib/bcx/resources/project.rb
|
64
|
-
</a>
|
65
|
-
|
66
|
-
|
67
|
-
<a class="source" href="todo.html">
|
68
|
-
lib/bcx/resources/todo.rb
|
69
|
-
</a>
|
70
|
-
|
71
|
-
|
72
|
-
<a class="source" href="todolist.html">
|
73
|
-
lib/bcx/resources/todolist.rb
|
74
|
-
</a>
|
75
|
-
|
76
|
-
|
77
|
-
<a class="source" href="../response_error.html">
|
78
|
-
lib/bcx/response_error.rb
|
79
|
-
</a>
|
80
|
-
|
81
|
-
|
82
|
-
<a class="source" href="../version.html">
|
83
|
-
lib/bcx/version.rb
|
84
|
-
</a>
|
85
|
-
|
86
|
-
</div>
|
87
|
-
</li>
|
88
|
-
</ul>
|
89
|
-
|
90
|
-
<ul class="sections">
|
91
|
-
|
92
|
-
<li id="title">
|
93
|
-
<div class="annotation">
|
94
|
-
<h1>todolist.rb</h1>
|
95
|
-
</div>
|
96
|
-
</li>
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
<li id="section-1">
|
101
|
-
<div class="annotation">
|
102
|
-
|
103
|
-
<div class="pilwrap for-h2">
|
104
|
-
<a class="pilcrow" href="#section-1">¶</a>
|
105
|
-
</div>
|
106
|
-
<h2>Todolists</h2>
|
107
|
-
<p>Provides access to todolist resoource both at the client level and per-project</p>
|
108
|
-
<h4>Get all todolists for a project</h4>
|
109
|
-
<p><code>GET /projects/123/todolists.json</code></p>
|
110
|
-
<pre><code>client.projects(<span class="number">123</span>).todolists!</code></pre>
|
111
|
-
<h4>Get all completed todolists for a project</h4>
|
112
|
-
<p><code>GET /projects/1/todolists/completed.json</code></p>
|
113
|
-
<pre><code>client.projects(<span class="number">123</span>).todolists.completed!</code></pre>
|
114
|
-
<h4>Get todolists for all projects</h4>
|
115
|
-
<p><code>GET /todolists.json</code></p>
|
116
|
-
<pre><code>client.todolists!</code></pre>
|
117
|
-
<h4>Get completed todolists for all projects</h4>
|
118
|
-
<p><code>GET /todolists/completed.json</code></p>
|
119
|
-
<pre><code>client.todolists.completed!</code></pre>
|
120
|
-
<h4>Get specific todolist including the todos</h4>
|
121
|
-
<p><code>GET /projects/123/todolists/456.json</code></p>
|
122
|
-
<pre><code>client.projects(<span class="number">123</span>).todolists!(<span class="number">456</span>)</code></pre>
|
123
|
-
<h4>Create a new todolist</h4>
|
124
|
-
<p><code>POST /projects/1/todolists.json</code></p>
|
125
|
-
<pre><code>client.projects(<span class="number">123</span>).todolists.create!(<span class="symbol">name:</span> <span class="string">'My todolist'</span>, <span class="symbol">description:</span> <span class="string">'This is a todolist'</span>)</code></pre>
|
126
|
-
<h4>Update an existing todolist</h4>
|
127
|
-
<p><code>PUT /projects/123/todolists/456.json</code></p>
|
128
|
-
<pre><code>client.projects(<span class="number">123</span>).todolists(<span class="number">456</span>).update!(<span class="symbol">name:</span> <span class="string">'Updated todolist'</span>)</code></pre>
|
129
|
-
<h4>Delete a todolist</h4>
|
130
|
-
<p><code>DELETE /projects/123/todolists/456.json</code></p>
|
131
|
-
<pre><code>client.projects(<span class="number">123</span>).todolists(<span class="number">456</span>).delete!</code></pre>
|
132
|
-
|
133
|
-
</div>
|
134
|
-
|
135
|
-
<div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">module</span> <span class="title">Bcx</span></span>
|
136
|
-
<span class="class"><span class="keyword">module</span> <span class="title">Resources</span></span>
|
137
|
-
<span class="class"><span class="keyword">class</span> <span class="title">Todolist</span> <span class="inheritance">< <span class="parent">Rapidash::Base</span></span></span>
|
138
|
-
resource <span class="symbol">:todos</span>, <span class="symbol">class_name:</span> <span class="string">'Bcx::Resources::Todo'</span>
|
139
|
-
|
140
|
-
collection <span class="symbol">:completed</span>
|
141
|
-
<span class="keyword">end</span>
|
142
|
-
<span class="keyword">end</span>
|
143
|
-
<span class="keyword">end</span></pre></div></div>
|
144
|
-
|
145
|
-
</li>
|
146
|
-
|
147
|
-
</ul>
|
148
|
-
</div>
|
149
|
-
</body>
|
150
|
-
</html>
|
@@ -1,96 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<title>response_error.rb</title>
|
6
|
-
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
7
|
-
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
8
|
-
<link rel="stylesheet" media="all" href="../../docco.css" />
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<div id="container">
|
12
|
-
<div id="background"></div>
|
13
|
-
|
14
|
-
<ul id="jump_to">
|
15
|
-
<li>
|
16
|
-
<a class="large" href="javascript:void(0);">Jump To …</a>
|
17
|
-
<a class="small" href="javascript:void(0);">+</a>
|
18
|
-
<div id="jump_wrapper">
|
19
|
-
<div id="jump_page">
|
20
|
-
|
21
|
-
|
22
|
-
<a class="source" href="configuration.html">
|
23
|
-
lib/bcx/configuration.rb
|
24
|
-
</a>
|
25
|
-
|
26
|
-
|
27
|
-
<a class="source" href="response_error.html">
|
28
|
-
lib/bcx/response_error.rb
|
29
|
-
</a>
|
30
|
-
|
31
|
-
|
32
|
-
<a class="source" href="version.html">
|
33
|
-
lib/bcx/version.rb
|
34
|
-
</a>
|
35
|
-
|
36
|
-
</div>
|
37
|
-
</li>
|
38
|
-
</ul>
|
39
|
-
|
40
|
-
<ul class="sections">
|
41
|
-
|
42
|
-
<li id="title">
|
43
|
-
<div class="annotation">
|
44
|
-
<h1>response_error.rb</h1>
|
45
|
-
</div>
|
46
|
-
</li>
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
<li id="section-1">
|
51
|
-
<div class="annotation">
|
52
|
-
|
53
|
-
<div class="pilwrap for-h2">
|
54
|
-
<a class="pilcrow" href="#section-1">¶</a>
|
55
|
-
</div>
|
56
|
-
<h2>Response Error</h2>
|
57
|
-
<p>If the response whilst fetching a resource is a 4xx or 5xx, Bcx will raise a <code>Bcx::ResponseError</code> exception.</p>
|
58
|
-
<p>Examples:</p>
|
59
|
-
<pre><code>client.projects.create!(<span class="symbol">name:</span> <span class="string">''</span>)
|
60
|
-
=> <span class="constant">Bcx::ResponseError</span><span class="symbol">:</span> <span class="number">422</span> <span class="constant">POST</span> <span class="symbol">https:</span>/<span class="regexp">/basecamp.com/</span><span class="number">2274488</span>/api/v1/projects.json | <span class="constant">Errors</span><span class="symbol">:</span> name can<span class="string">'t be blank</code></pre>
|
61
|
-
<p>You can rescue this exception to grab the status, method, URL and errors individually.</p>
|
62
|
-
<pre><code><span class="keyword">begin</span>
|
63
|
-
client.projects.create!(<span class="symbol">name:</span> <span class="string">''</span>)
|
64
|
-
<span class="keyword">rescue</span> <span class="constant">Bcx::ResponseError</span> => response
|
65
|
-
response.method <span class="comment"># => "POST"</span>
|
66
|
-
response.status <span class="comment"># => 422</span>
|
67
|
-
response.url <span class="comment"># => "https://basecamp.com/2274488/api/v1/projects.json"</span>
|
68
|
-
response.errors <span class="comment"># => ["name can't be blank"]</span>
|
69
|
-
<span class="keyword">end</span></code></pre>
|
70
|
-
|
71
|
-
</div>
|
72
|
-
|
73
|
-
<div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">module</span> <span class="title">Bcx</span></span>
|
74
|
-
<span class="class"><span class="keyword">class</span> <span class="title">ResponseError</span> <span class="inheritance">< <span class="parent">Rapidash::ResponseError</span></span></span>
|
75
|
-
|
76
|
-
<span class="function"><span class="keyword">def</span> <span class="title">errors</span></span>
|
77
|
-
<span class="keyword">return</span> body <span class="keyword">if</span> body.kind_of?(<span class="constant">String</span>)
|
78
|
-
|
79
|
-
messages = []
|
80
|
-
|
81
|
-
body.each_pair <span class="keyword">do</span> |attribute, msgs|
|
82
|
-
msgs.each { |msg| messages.push <span class="string">"<span class="subst">#{attribute}</span> <span class="subst">#{msg}</span>"</span> }
|
83
|
-
<span class="keyword">end</span>
|
84
|
-
|
85
|
-
messages.join(<span class="string">', '</span>)
|
86
|
-
<span class="keyword">end</span>
|
87
|
-
|
88
|
-
<span class="keyword">end</span>
|
89
|
-
<span class="keyword">end</span></pre></div></div>
|
90
|
-
|
91
|
-
</li>
|
92
|
-
|
93
|
-
</ul>
|
94
|
-
</div>
|
95
|
-
</body>
|
96
|
-
</html>
|
data/docs/lib/bcx/version.html
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<title>version.rb</title>
|
6
|
-
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
7
|
-
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
|
8
|
-
<link rel="stylesheet" media="all" href="../../docco.css" />
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<div id="container">
|
12
|
-
<div id="background"></div>
|
13
|
-
|
14
|
-
<ul id="jump_to">
|
15
|
-
<li>
|
16
|
-
<a class="large" href="javascript:void(0);">Jump To …</a>
|
17
|
-
<a class="small" href="javascript:void(0);">+</a>
|
18
|
-
<div id="jump_wrapper">
|
19
|
-
<div id="jump_page">
|
20
|
-
|
21
|
-
|
22
|
-
<a class="source" href="configuration.html">
|
23
|
-
lib/bcx/configuration.rb
|
24
|
-
</a>
|
25
|
-
|
26
|
-
|
27
|
-
<a class="source" href="response_error.html">
|
28
|
-
lib/bcx/response_error.rb
|
29
|
-
</a>
|
30
|
-
|
31
|
-
|
32
|
-
<a class="source" href="version.html">
|
33
|
-
lib/bcx/version.rb
|
34
|
-
</a>
|
35
|
-
|
36
|
-
</div>
|
37
|
-
</li>
|
38
|
-
</ul>
|
39
|
-
|
40
|
-
<ul class="sections">
|
41
|
-
|
42
|
-
<li id="title">
|
43
|
-
<div class="annotation">
|
44
|
-
<h1>version.rb</h1>
|
45
|
-
</div>
|
46
|
-
</li>
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
<li id="section-1">
|
51
|
-
<div class="annotation">
|
52
|
-
|
53
|
-
<div class="pilwrap ">
|
54
|
-
<a class="pilcrow" href="#section-1">¶</a>
|
55
|
-
</div>
|
56
|
-
|
57
|
-
</div>
|
58
|
-
|
59
|
-
<div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">module</span> <span class="title">Bcx</span></span>
|
60
|
-
<span class="constant">VERSION</span> = <span class="string">"0.2.1"</span>
|
61
|
-
<span class="keyword">end</span></pre></div></div>
|
62
|
-
|
63
|
-
</li>
|
64
|
-
|
65
|
-
</ul>
|
66
|
-
</div>
|
67
|
-
</body>
|
68
|
-
</html>
|