zendesk_api 0.2.6 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. data/.gitignore +2 -1
  2. data/Gemfile +7 -0
  3. data/Gemfile.lock +10 -2
  4. data/LICENSE +176 -19
  5. data/Readme.md +13 -5
  6. data/config/newrelic.yml +255 -0
  7. data/lib/zendesk_api/association.rb +1 -1
  8. data/lib/zendesk_api/associations.rb +129 -100
  9. data/lib/zendesk_api/client.rb +44 -25
  10. data/lib/zendesk_api/collection.rb +83 -58
  11. data/lib/zendesk_api/console/extensions.rb +47 -28
  12. data/lib/zendesk_api/server/base.rb +4 -0
  13. data/lib/zendesk_api/server/docs/account_settings.md +8 -0
  14. data/lib/zendesk_api/server/docs/automations.md +6 -0
  15. data/lib/zendesk_api/server/docs/changes_roadmap.md +76 -1
  16. data/lib/zendesk_api/server/docs/forum_subscriptions.md +2 -2
  17. data/lib/zendesk_api/server/docs/introduction.md +4 -2
  18. data/lib/zendesk_api/server/docs/macros.md +2 -0
  19. data/lib/zendesk_api/server/docs/organizations.md +3 -4
  20. data/lib/zendesk_api/server/docs/requests.md +21 -7
  21. data/lib/zendesk_api/server/docs/tickets.md +64 -8
  22. data/lib/zendesk_api/server/docs/topic_subscriptions.md +3 -3
  23. data/lib/zendesk_api/server/docs/topic_votes.md +0 -1
  24. data/lib/zendesk_api/server/docs/triggers.md +7 -0
  25. data/lib/zendesk_api/server/docs/users.md +4 -4
  26. data/lib/zendesk_api/server/docs/views.md +57 -8
  27. data/lib/zendesk_api/server/public/doc/ZendeskAPI.html +131 -0
  28. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ability.html +190 -0
  29. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Activity.html +616 -0
  30. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Attachment.html +362 -0
  31. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Automation.html +438 -0
  32. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Bookmark.html +243 -0
  33. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CRMData.html +190 -0
  34. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CRMDataStatus.html +190 -0
  35. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Category.html +462 -0
  36. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Client.html +1490 -0
  37. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Collection.html +2825 -0
  38. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Configuration.html +1212 -0
  39. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Console.html +860 -0
  40. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Console/Eval.html +190 -0
  41. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Create.html +134 -0
  42. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Create/ClassMethods.html +322 -0
  43. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CreateResource.html +222 -0
  44. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CustomRole.html +190 -0
  45. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Data.html +1432 -0
  46. data/lib/zendesk_api/server/public/doc/ZendeskAPI/DataResource.html +348 -0
  47. data/lib/zendesk_api/server/public/doc/ZendeskAPI/DeleteResource.html +216 -0
  48. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Destroy.html +307 -0
  49. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Destroy/ClassMethod.html +245 -0
  50. data/lib/zendesk_api/server/public/doc/ZendeskAPI/FormatError.html +123 -0
  51. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Forum.html +1196 -0
  52. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ForumSubscription.html +616 -0
  53. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Group.html +243 -0
  54. data/lib/zendesk_api/server/public/doc/ZendeskAPI/GroupMembership.html +616 -0
  55. data/lib/zendesk_api/server/public/doc/ZendeskAPI/JobStatus.html +209 -0
  56. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Locale.html +209 -0
  57. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Macro.html +438 -0
  58. data/lib/zendesk_api/server/public/doc/ZendeskAPI/MobileDevice.html +361 -0
  59. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Organization.html +1016 -0
  60. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Read.html +278 -0
  61. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ReadResource.html +220 -0
  62. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Request.html +826 -0
  63. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Request/Comment.html +604 -0
  64. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Resource.html +258 -0
  65. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Role.html +190 -0
  66. data/lib/zendesk_api/server/public/doc/ZendeskAPI/RuleExecution.html +383 -0
  67. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SatisfactionRating.html +938 -0
  68. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Save.html +510 -0
  69. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Search.html +403 -0
  70. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Search/Result.html +166 -0
  71. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Server.html +131 -0
  72. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Server/App.html +523 -0
  73. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Server/Helper.html +684 -0
  74. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Server/HtmlRenderer.html +303 -0
  75. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Server/HtmlRenderer/RedcarpetRenderer.html +508 -0
  76. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Server/UserRequest.html +125 -0
  77. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Server/ZlibJSON.html +244 -0
  78. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Setting.html +350 -0
  79. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SharingAgreement.html +209 -0
  80. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SingularResource.html +247 -0
  81. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SuspendedTicket.html +342 -0
  82. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket.html +2731 -0
  83. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket/Audit.html +385 -0
  84. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket/Comment.html +636 -0
  85. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket/Tag.html +243 -0
  86. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TicketField.html +243 -0
  87. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TicketMetric.html +205 -0
  88. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Topic.html +1086 -0
  89. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Topic/TopicComment.html +232 -0
  90. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Topic/TopicVote.html +624 -0
  91. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TopicComment.html +743 -0
  92. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TopicSubscription.html +616 -0
  93. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Trigger.html +438 -0
  94. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Update.html +140 -0
  95. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Update/ClassMethod.html +237 -0
  96. data/lib/zendesk_api/server/public/doc/ZendeskAPI/UpdateResource.html +222 -0
  97. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Upload.html +404 -0
  98. data/lib/zendesk_api/server/public/doc/ZendeskAPI/User.html +3611 -0
  99. data/lib/zendesk_api/server/public/doc/ZendeskAPI/User/Identity.html +563 -0
  100. data/lib/zendesk_api/server/public/doc/ZendeskAPI/User/TopicComment.html +194 -0
  101. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Verbs.html +338 -0
  102. data/lib/zendesk_api/server/public/doc/ZendeskAPI/View.html +1283 -0
  103. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ViewCount.html +190 -0
  104. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ViewRow.html +1342 -0
  105. data/lib/zendesk_api/server/public/doc/_index.html +799 -0
  106. data/lib/zendesk_api/server/public/doc/class_list.html +53 -0
  107. data/lib/zendesk_api/server/public/doc/css/common.css +1 -0
  108. data/lib/zendesk_api/server/public/doc/css/full_list.css +57 -0
  109. data/lib/zendesk_api/server/public/doc/css/style.css +328 -0
  110. data/lib/zendesk_api/server/public/doc/file.Readme.html +377 -0
  111. data/lib/zendesk_api/server/public/doc/file_list.html +55 -0
  112. data/lib/zendesk_api/server/public/doc/frames.html +28 -0
  113. data/lib/zendesk_api/server/public/doc/index.html +377 -0
  114. data/lib/zendesk_api/server/public/doc/js/app.js +214 -0
  115. data/lib/zendesk_api/server/public/doc/js/full_list.js +173 -0
  116. data/lib/zendesk_api/server/public/doc/js/jquery.js +4 -0
  117. data/lib/zendesk_api/server/public/doc/method_list.html +2540 -0
  118. data/lib/zendesk_api/server/public/doc/top-level-namespace.html +144 -0
  119. data/lib/zendesk_api/version.rb +1 -1
  120. data/zendesk_api.gemspec +1 -1
  121. metadata +96 -3
@@ -0,0 +1,684 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: ZendeskAPI::Server::Helper
8
+
9
+ &mdash; Documentation by YARD 0.8.4.1
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../_index.html">Index (H)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../ZendeskAPI.html" title="ZendeskAPI (module)">ZendeskAPI</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Server.html" title="ZendeskAPI::Server (module)">Server</a></span></span>
36
+ &raquo;
37
+ <span class="title">Helper</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: ZendeskAPI::Server::Helper
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dt class="r1 last">Defined in:</dt>
82
+ <dd class="r1 last">lib/zendesk_api/server/helper.rb</dd>
83
+
84
+ </dl>
85
+ <div class="clear"></div>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <h2>
96
+ Instance Method Summary
97
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
98
+ </h2>
99
+
100
+ <ul class="summary">
101
+
102
+ <li class="public ">
103
+ <span class="summary_signature">
104
+
105
+ <a href="#client-instance_method" title="#client (instance method)">- (Object) <strong>client</strong>(params = params) </a>
106
+
107
+
108
+
109
+ </span>
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+ <span class="summary_desc"><div class='inline'></div></span>
120
+
121
+ </li>
122
+
123
+
124
+ <li class="public ">
125
+ <span class="summary_signature">
126
+
127
+ <a href="#coerce_path-instance_method" title="#coerce_path (instance method)">- (Object) <strong>coerce_path</strong>(path) </a>
128
+
129
+
130
+
131
+ </span>
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+ <span class="summary_desc"><div class='inline'></div></span>
142
+
143
+ </li>
144
+
145
+
146
+ <li class="public ">
147
+ <span class="summary_signature">
148
+
149
+ <a href="#execute_request-instance_method" title="#execute_request (instance method)">- (Object) <strong>execute_request</strong> </a>
150
+
151
+
152
+
153
+ </span>
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+ <span class="summary_desc"><div class='inline'></div></span>
164
+
165
+ </li>
166
+
167
+
168
+ <li class="public ">
169
+ <span class="summary_signature">
170
+
171
+ <a href="#full_url-instance_method" title="#full_url (instance method)">- (Object) <strong>full_url</strong> </a>
172
+
173
+
174
+
175
+ </span>
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+ <span class="summary_desc"><div class='inline'></div></span>
186
+
187
+ </li>
188
+
189
+
190
+ <li class="public ">
191
+ <span class="summary_signature">
192
+
193
+ <a href="#get_response-instance_method" title="#get_response (instance method)">- (Object) <strong>get_response</strong> </a>
194
+
195
+
196
+
197
+ </span>
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+ <span class="summary_desc"><div class='inline'></div></span>
208
+
209
+ </li>
210
+
211
+
212
+ <li class="public ">
213
+ <span class="summary_signature">
214
+
215
+ <a href="#map_headers-instance_method" title="#map_headers (instance method)">- (Object) <strong>map_headers</strong>(headers) </a>
216
+
217
+
218
+
219
+ </span>
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+ <span class="summary_desc"><div class='inline'></div></span>
230
+
231
+ </li>
232
+
233
+
234
+ <li class="public ">
235
+ <span class="summary_signature">
236
+
237
+ <a href="#set_request-instance_method" title="#set_request (instance method)">- (Object) <strong>set_request</strong>(request) </a>
238
+
239
+
240
+
241
+ </span>
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+ <span class="summary_desc"><div class='inline'></div></span>
252
+
253
+ </li>
254
+
255
+
256
+ <li class="public ">
257
+ <span class="summary_signature">
258
+
259
+ <a href="#set_response-instance_method" title="#set_response (instance method)">- (Object) <strong>set_response</strong>(response) </a>
260
+
261
+
262
+
263
+ </span>
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+ <span class="summary_desc"><div class='inline'></div></span>
274
+
275
+ </li>
276
+
277
+
278
+ </ul>
279
+
280
+
281
+
282
+
283
+ <div id="instance_method_details" class="method_details_list">
284
+ <h2>Instance Method Details</h2>
285
+
286
+
287
+ <div class="method_details first">
288
+ <h3 class="signature first" id="client-instance_method">
289
+
290
+ - (<tt>Object</tt>) <strong>client</strong>(params = params)
291
+
292
+
293
+
294
+
295
+
296
+ </h3><table class="source_code">
297
+ <tr>
298
+ <td>
299
+ <pre class="lines">
300
+
301
+
302
+ 98
303
+ 99
304
+ 100
305
+ 101
306
+ 102
307
+ 103
308
+ 104
309
+ 105
310
+ 106</pre>
311
+ </td>
312
+ <td>
313
+ <pre class="code"><span class="info file"># File 'lib/zendesk_api/server/helper.rb', line 98</span>
314
+
315
+ <span class='kw'>def</span> <span class='id identifier rubyid_client'>client</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
316
+ <span class='ivar'>@client</span> <span class='op'>||=</span> <span class='const'>ZendeskAPI</span><span class='op'>::</span><span class='const'>Client</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span>
317
+ <span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
318
+ <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
319
+ <span class='kw'>end</span>
320
+
321
+ <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_allow_http'>allow_http</span> <span class='op'>=</span> <span class='const'>App</span><span class='period'>.</span><span class='id identifier rubyid_development?'>development?</span>
322
+ <span class='kw'>end</span>
323
+ <span class='kw'>end</span></pre>
324
+ </td>
325
+ </tr>
326
+ </table>
327
+ </div>
328
+
329
+ <div class="method_details ">
330
+ <h3 class="signature " id="coerce_path-instance_method">
331
+
332
+ - (<tt>Object</tt>) <strong>coerce_path</strong>(path)
333
+
334
+
335
+
336
+
337
+
338
+ </h3><table class="source_code">
339
+ <tr>
340
+ <td>
341
+ <pre class="lines">
342
+
343
+
344
+ 7
345
+ 8
346
+ 9
347
+ 10
348
+ 11
349
+ 12
350
+ 13
351
+ 14
352
+ 15
353
+ 16
354
+ 17
355
+ 18
356
+ 19
357
+ 20
358
+ 21
359
+ 22
360
+ 23</pre>
361
+ </td>
362
+ <td>
363
+ <pre class="code"><span class="info file"># File 'lib/zendesk_api/server/helper.rb', line 7</span>
364
+
365
+ <span class='kw'>def</span> <span class='id identifier rubyid_coerce_path'>coerce_path</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
366
+ <span class='kw'>if</span> <span class='id identifier rubyid_path'>path</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>(https?://)?(\w+)(\.zendesk\.com)?(/api/v2)?/(.*)</span><span class='regexp_end'>}</span></span>
367
+ <span class='kw'>if</span> <span class='backref'>$1</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>http://</span><span class='tstring_end'>&quot;</span></span>
368
+ <span class='ivar'>@error</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Please enter a valid https URL</span><span class='tstring_end'>&quot;</span></span>
369
+ <span class='id identifier rubyid_path'>path</span>
370
+ <span class='kw'>elsif</span> <span class='op'>!</span><span class='backref'>$2</span> <span class='op'>||</span> <span class='backref'>$2</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
371
+ <span class='ivar'>@error</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Please enter a valid subdomain</span><span class='tstring_end'>&quot;</span></span>
372
+ <span class='id identifier rubyid_path'>path</span>
373
+ <span class='kw'>else</span>
374
+ <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>url</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>https://</span><span class='embexpr_beg'>#{</span><span class='backref'>$2</span><span class='rbrace'>}</span><span class='tstring_content'>.zendesk.com/api/v2</span><span class='tstring_end'>&quot;</span></span>
375
+ <span class='backref'>$5</span>
376
+ <span class='kw'>end</span>
377
+ <span class='kw'>else</span>
378
+ <span class='ivar'>@error</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Please enter a valid URL</span><span class='tstring_end'>&quot;</span></span>
379
+ <span class='id identifier rubyid_path'>path</span>
380
+ <span class='kw'>end</span>
381
+ <span class='kw'>end</span></pre>
382
+ </td>
383
+ </tr>
384
+ </table>
385
+ </div>
386
+
387
+ <div class="method_details ">
388
+ <h3 class="signature " id="execute_request-instance_method">
389
+
390
+ - (<tt>Object</tt>) <strong>execute_request</strong>
391
+
392
+
393
+
394
+
395
+
396
+ </h3><table class="source_code">
397
+ <tr>
398
+ <td>
399
+ <pre class="lines">
400
+
401
+
402
+ 25
403
+ 26
404
+ 27
405
+ 28
406
+ 29
407
+ 30
408
+ 31
409
+ 32
410
+ 33
411
+ 34
412
+ 35
413
+ 36
414
+ 37
415
+ 38
416
+ 39
417
+ 40
418
+ 41
419
+ 42
420
+ 43
421
+ 44
422
+ 45
423
+ 46</pre>
424
+ </td>
425
+ <td>
426
+ <pre class="code"><span class="info file"># File 'lib/zendesk_api/server/helper.rb', line 25</span>
427
+
428
+ <span class='kw'>def</span> <span class='id identifier rubyid_execute_request'>execute_request</span>
429
+ <span class='kw'>unless</span> <span class='ivar'>@method</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='ivar'>@method</span><span class='rparen'>)</span>
430
+ <span class='ivar'>@error</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>The input you entered was invalid</span><span class='tstring_end'>&quot;</span></span>
431
+ <span class='kw'>return</span>
432
+ <span class='kw'>end</span>
433
+
434
+ <span class='kw'>begin</span>
435
+ <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_get_response'>get_response</span>
436
+ <span class='kw'>rescue</span> <span class='const'>Faraday</span><span class='op'>::</span><span class='const'>Error</span><span class='op'>::</span><span class='const'>ConnectionFailed</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
437
+ <span class='ivar'>@error</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>The connection failed</span><span class='tstring_end'>&quot;</span></span>
438
+ <span class='kw'>rescue</span> <span class='const'>Faraday</span><span class='op'>::</span><span class='const'>Error</span><span class='op'>::</span><span class='const'>ClientError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
439
+ <span class='id identifier rubyid_set_response'>set_response</span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span>
440
+ <span class='kw'>rescue</span> <span class='const'>JSON</span><span class='op'>::</span><span class='const'>ParserError</span>
441
+ <span class='ivar'>@error</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>The JSON you attempted to send was invalid</span><span class='tstring_end'>&quot;</span></span>
442
+ <span class='kw'>rescue</span> <span class='const'>URI</span><span class='op'>::</span><span class='const'>InvalidURIError</span><span class='comma'>,</span> <span class='const'>ArgumentError</span>
443
+ <span class='ivar'>@error</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Please enter a valid URL</span><span class='tstring_end'>&quot;</span></span>
444
+ <span class='kw'>else</span>
445
+ <span class='id identifier rubyid_set_response'>set_response</span><span class='lparen'>(</span><span class='symbol'>:body</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='comma'>,</span>
446
+ <span class='symbol'>:headers</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='symbol'>:response_headers</span><span class='rbracket'>]</span><span class='comma'>,</span>
447
+ <span class='symbol'>:status</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='symbol'>:status</span><span class='rbracket'>]</span><span class='rparen'>)</span>
448
+ <span class='kw'>end</span>
449
+ <span class='kw'>end</span></pre>
450
+ </td>
451
+ </tr>
452
+ </table>
453
+ </div>
454
+
455
+ <div class="method_details ">
456
+ <h3 class="signature " id="full_url-instance_method">
457
+
458
+ - (<tt>Object</tt>) <strong>full_url</strong>
459
+
460
+
461
+
462
+
463
+
464
+ </h3><table class="source_code">
465
+ <tr>
466
+ <td>
467
+ <pre class="lines">
468
+
469
+
470
+ 3
471
+ 4
472
+ 5</pre>
473
+ </td>
474
+ <td>
475
+ <pre class="code"><span class="info file"># File 'lib/zendesk_api/server/helper.rb', line 3</span>
476
+
477
+ <span class='kw'>def</span> <span class='id identifier rubyid_full_url'>full_url</span>
478
+ <span class='lbracket'>[</span><span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>url</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@path</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
479
+ <span class='kw'>end</span></pre>
480
+ </td>
481
+ </tr>
482
+ </table>
483
+ </div>
484
+
485
+ <div class="method_details ">
486
+ <h3 class="signature " id="get_response-instance_method">
487
+
488
+ - (<tt>Object</tt>) <strong>get_response</strong>
489
+
490
+
491
+
492
+
493
+
494
+ </h3><table class="source_code">
495
+ <tr>
496
+ <td>
497
+ <pre class="lines">
498
+
499
+
500
+ 48
501
+ 49
502
+ 50
503
+ 51
504
+ 52
505
+ 53
506
+ 54
507
+ 55
508
+ 56
509
+ 57
510
+ 58
511
+ 59
512
+ 60</pre>
513
+ </td>
514
+ <td>
515
+ <pre class="code"><span class="info file"># File 'lib/zendesk_api/server/helper.rb', line 48</span>
516
+
517
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_response'>get_response</span>
518
+ <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='ivar'>@method</span><span class='comma'>,</span> <span class='ivar'>@path</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_request'>request</span><span class='op'>|</span>
519
+ <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='ivar'>@url_params</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_accum'>accum</span><span class='comma'>,</span> <span class='id identifier rubyid_h'>h</span><span class='op'>|</span>
520
+ <span class='id identifier rubyid_accum'>accum</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>name</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>value</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
521
+ <span class='kw'>end</span>
522
+
523
+ <span class='kw'>if</span> <span class='ivar'>@method</span> <span class='op'>!=</span> <span class='symbol'>:get</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@json</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='ivar'>@json</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
524
+ <span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='ivar'>@json</span><span class='rparen'>)</span>
525
+ <span class='kw'>end</span>
526
+
527
+ <span class='id identifier rubyid_set_request'>set_request</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='period'>.</span><span class='id identifier rubyid_to_env'>to_env</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_connection'>connection</span><span class='rparen'>)</span><span class='rparen'>)</span>
528
+ <span class='kw'>end</span>
529
+ <span class='kw'>end</span></pre>
530
+ </td>
531
+ </tr>
532
+ </table>
533
+ </div>
534
+
535
+ <div class="method_details ">
536
+ <h3 class="signature " id="map_headers-instance_method">
537
+
538
+ - (<tt>Object</tt>) <strong>map_headers</strong>(headers)
539
+
540
+
541
+
542
+
543
+
544
+ </h3><table class="source_code">
545
+ <tr>
546
+ <td>
547
+ <pre class="lines">
548
+
549
+
550
+ 62
551
+ 63
552
+ 64
553
+ 65
554
+ 66
555
+ 67</pre>
556
+ </td>
557
+ <td>
558
+ <pre class="code"><span class="info file"># File 'lib/zendesk_api/server/helper.rb', line 62</span>
559
+
560
+ <span class='kw'>def</span> <span class='id identifier rubyid_map_headers'>map_headers</span><span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='rparen'>)</span>
561
+ <span class='id identifier rubyid_headers'>headers</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
562
+ <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_k'>k</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>-</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:capitalize</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>-</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
563
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_v'>v</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
564
+ <span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
565
+ <span class='kw'>end</span></pre>
566
+ </td>
567
+ </tr>
568
+ </table>
569
+ </div>
570
+
571
+ <div class="method_details ">
572
+ <h3 class="signature " id="set_request-instance_method">
573
+
574
+ - (<tt>Object</tt>) <strong>set_request</strong>(request)
575
+
576
+
577
+
578
+
579
+
580
+ </h3><table class="source_code">
581
+ <tr>
582
+ <td>
583
+ <pre class="lines">
584
+
585
+
586
+ 69
587
+ 70
588
+ 71
589
+ 72
590
+ 73
591
+ 74
592
+ 75
593
+ 76
594
+ 77
595
+ 78
596
+ 79
597
+ 80
598
+ 81
599
+ 82
600
+ 83
601
+ 84</pre>
602
+ </td>
603
+ <td>
604
+ <pre class="code"><span class="info file"># File 'lib/zendesk_api/server/helper.rb', line 69</span>
605
+
606
+ <span class='kw'>def</span> <span class='id identifier rubyid_set_request'>set_request</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='rparen'>)</span>
607
+ <span class='ivar'>@html_request</span> <span class='op'>=</span> <span class='heredoc_beg'>&lt;&lt;-END</span>
608
+ <span class='tstring_content'>HTTP/1.1 </span><span class='embexpr_beg'>#{</span><span class='ivar'>@method</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span><span class='rbrace'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_request'>request</span><span class='lbracket'>[</span><span class='symbeg'>:</span><span class='id identifier rubyid_url'>url</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>
609
+ </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_map_headers'>map_headers</span><span class='lparen'>(</span><span class='id identifier rubyid_request'>request</span><span class='lbracket'>[</span><span class='symbeg'>:</span><span class='id identifier rubyid_request_headers'>request_headers</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>
610
+ </span><span class='heredoc_end'> END
611
+ </span>
612
+ <span class='id identifier rubyid_request_headers'>request_headers</span> <span class='op'>=</span> <span class='id identifier rubyid_request'>request</span><span class='lbracket'>[</span><span class='symbol'>:request_headers</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
613
+ <span class='id identifier rubyid_request_headers'>request_headers</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Authorization</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
614
+
615
+ <span class='ivar'>@user_request_hash</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='symbol'>:url</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_request'>request</span><span class='lbracket'>[</span><span class='symbol'>:url</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span> <span class='symbol'>:request_headers</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_request_headers'>request_headers</span> <span class='rbrace'>}</span>
616
+
617
+ <span class='kw'>if</span> <span class='ivar'>@method</span> <span class='op'>!=</span> <span class='symbol'>:get</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@json</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='ivar'>@json</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
618
+ <span class='id identifier rubyid_parsed_json'>parsed_json</span> <span class='op'>=</span> <span class='const'>CodeRay</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='ivar'>@json</span><span class='comma'>,</span> <span class='symbol'>:json</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_span'>span</span>
619
+ <span class='ivar'>@html_request</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_parsed_json'>parsed_json</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
620
+ <span class='kw'>end</span>
621
+ <span class='kw'>end</span></pre>
622
+ </td>
623
+ </tr>
624
+ </table>
625
+ </div>
626
+
627
+ <div class="method_details ">
628
+ <h3 class="signature " id="set_response-instance_method">
629
+
630
+ - (<tt>Object</tt>) <strong>set_response</strong>(response)
631
+
632
+
633
+
634
+
635
+
636
+ </h3><table class="source_code">
637
+ <tr>
638
+ <td>
639
+ <pre class="lines">
640
+
641
+
642
+ 86
643
+ 87
644
+ 88
645
+ 89
646
+ 90
647
+ 91
648
+ 92
649
+ 93
650
+ 94
651
+ 95
652
+ 96</pre>
653
+ </td>
654
+ <td>
655
+ <pre class="code"><span class="info file"># File 'lib/zendesk_api/server/helper.rb', line 86</span>
656
+
657
+ <span class='kw'>def</span> <span class='id identifier rubyid_set_response'>set_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
658
+ <span class='ivar'>@html_response</span> <span class='op'>=</span><span class='heredoc_beg'>&lt;&lt;-END</span>
659
+ <span class='tstring_content'>HTTP/1.1 </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='symbeg'>:</span><span class='id identifier rubyid_status'>status</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>
660
+ </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_map_headers'>map_headers</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='symbeg'>:</span><span class='id identifier rubyid_headers'>headers</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>
661
+
662
+
663
+ </span><span class='embexpr_beg'>#{</span><span class='const'>CodeRay</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_pretty_generate'>pretty_generate</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='symbeg'>:</span><span class='id identifier rubyid_body'>body</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='symbeg'>:</span><span class='id identifier rubyid_json'>json</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_span'>span</span><span class='rbrace'>}</span><span class='tstring_content'>
664
+ </span><span class='heredoc_end'> END
665
+ </span>
666
+ <span class='ivar'>@user_response_hash</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='symbol'>:status</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='symbol'>:status</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:headers</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='symbol'>:headers</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:body</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='symbol'>:body</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
667
+ <span class='kw'>end</span></pre>
668
+ </td>
669
+ </tr>
670
+ </table>
671
+ </div>
672
+
673
+ </div>
674
+
675
+ </div>
676
+
677
+ <div id="footer">
678
+ Generated on Mon Feb 11 17:45:36 2013 by
679
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
680
+ 0.8.4.1 (ruby-1.9.3).
681
+ </div>
682
+
683
+ </body>
684
+ </html>