zendesk_api 0.3.14 → 0.4.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. data/.yardopts +6 -2
  2. data/Gemfile +3 -2
  3. data/Gemfile.lock +4 -4
  4. data/Readme.md +3 -268
  5. data/lib/zendesk_api/actions.rb +51 -46
  6. data/lib/zendesk_api/association.rb +1 -1
  7. data/lib/zendesk_api/associations.rb +2 -6
  8. data/lib/zendesk_api/client.rb +8 -9
  9. data/lib/zendesk_api/collection.rb +84 -50
  10. data/lib/zendesk_api/configuration.rb +4 -0
  11. data/lib/zendesk_api/error.rb +22 -0
  12. data/lib/zendesk_api/middleware/request/etag_cache.rb +1 -7
  13. data/lib/zendesk_api/middleware/request/upload.rb +1 -2
  14. data/lib/zendesk_api/middleware/response/raise_error.rb +20 -0
  15. data/lib/zendesk_api/resource.rb +33 -5
  16. data/lib/zendesk_api/resources.rb +36 -11
  17. data/lib/zendesk_api/server/base.rb +1 -1
  18. data/lib/zendesk_api/server/helper.rb +3 -3
  19. data/lib/zendesk_api/server/models/zlib_json.rb +1 -1
  20. data/lib/zendesk_api/server/public/doc/ZendeskAPI.html +7 -7
  21. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ability.html +415 -13
  22. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Activity.html +414 -51
  23. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Attachment.html +321 -25
  24. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Automation.html +413 -46
  25. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Bookmark.html +389 -26
  26. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CRMData.html +415 -13
  27. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CRMDataStatus.html +415 -13
  28. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Category.html +410 -47
  29. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Client.html +98 -362
  30. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Collection.html +457 -676
  31. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Configuration.html +110 -20
  32. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Create.html +264 -6
  33. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Create/ClassMethods.html +43 -82
  34. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CreateResource.html +671 -15
  35. data/lib/zendesk_api/server/public/doc/ZendeskAPI/CustomRole.html +415 -13
  36. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Data.html +207 -233
  37. data/lib/zendesk_api/server/public/doc/ZendeskAPI/DataResource.html +499 -24
  38. data/lib/zendesk_api/server/public/doc/ZendeskAPI/DeleteResource.html +614 -15
  39. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Destroy.html +73 -23
  40. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Destroy/ClassMethod.html +68 -18
  41. data/lib/zendesk_api/server/public/doc/ZendeskAPI/{FormatError.html → Error.html} +19 -27
  42. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Error/ClientError.html +127 -0
  43. data/lib/zendesk_api/server/public/doc/ZendeskAPI/{Server/UserRequest.html → Error/NetworkError.html} +18 -16
  44. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Error/RecordInvalid.html +371 -0
  45. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Error/RecordNotFound.html +127 -0
  46. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Forum.html +426 -63
  47. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ForumSubscription.html +414 -51
  48. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Group.html +389 -26
  49. data/lib/zendesk_api/server/public/doc/ZendeskAPI/GroupMembership.html +414 -51
  50. data/lib/zendesk_api/server/public/doc/ZendeskAPI/JobStatus.html +405 -16
  51. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Locale.html +405 -16
  52. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Macro.html +413 -46
  53. data/lib/zendesk_api/server/public/doc/ZendeskAPI/MobileDevice.html +404 -41
  54. data/lib/zendesk_api/server/public/doc/ZendeskAPI/OAuthClient.html +606 -0
  55. data/lib/zendesk_api/server/public/doc/ZendeskAPI/OAuthToken.html +810 -0
  56. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Organization.html +422 -59
  57. data/lib/zendesk_api/server/public/doc/ZendeskAPI/OrganizationField.html +606 -0
  58. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Read.html +75 -12
  59. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ReadResource.html +593 -16
  60. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Request.html +418 -55
  61. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Request/Comment.html +420 -31
  62. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Resource.html +1025 -20
  63. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Role.html +415 -13
  64. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Rule.html +610 -0
  65. data/lib/zendesk_api/server/public/doc/ZendeskAPI/RuleExecution.html +317 -21
  66. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SatisfactionRating.html +428 -39
  67. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Save.html +63 -79
  68. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Search.html +34 -26
  69. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Search/Result.html +305 -9
  70. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Setting.html +433 -41
  71. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SharingAgreement.html +405 -16
  72. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SingularResource.html +389 -26
  73. data/lib/zendesk_api/server/public/doc/ZendeskAPI/SuspendedTicket.html +600 -31
  74. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket.html +464 -101
  75. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket/Audit.html +427 -25
  76. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket/Comment.html +435 -32
  77. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Ticket/Tag.html +389 -26
  78. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TicketField.html +389 -26
  79. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TicketMetric.html +592 -15
  80. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Topic.html +427 -64
  81. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Topic/TopicComment.html +907 -17
  82. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Topic/TopicVote.html +414 -55
  83. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TopicComment.html +325 -29
  84. data/lib/zendesk_api/server/public/doc/ZendeskAPI/TopicSubscription.html +414 -51
  85. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Trigger.html +413 -46
  86. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Update.html +258 -6
  87. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Update/ClassMethod.html +62 -12
  88. data/lib/zendesk_api/server/public/doc/ZendeskAPI/UpdateResource.html +671 -15
  89. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Upload.html +800 -28
  90. data/lib/zendesk_api/server/public/doc/ZendeskAPI/User.html +505 -142
  91. data/lib/zendesk_api/server/public/doc/ZendeskAPI/User/Identity.html +412 -49
  92. data/lib/zendesk_api/server/public/doc/ZendeskAPI/User/TopicComment.html +475 -13
  93. data/lib/zendesk_api/server/public/doc/ZendeskAPI/UserField.html +606 -0
  94. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Verbs.html +9 -15
  95. data/lib/zendesk_api/server/public/doc/ZendeskAPI/View.html +433 -66
  96. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ViewCount.html +415 -13
  97. data/lib/zendesk_api/server/public/doc/ZendeskAPI/ViewRow.html +451 -49
  98. data/lib/zendesk_api/server/public/doc/_index.html +72 -72
  99. data/lib/zendesk_api/server/public/doc/class_list.html +1 -1
  100. data/lib/zendesk_api/server/public/doc/css/style.css +10 -0
  101. data/lib/zendesk_api/server/public/doc/file.Readme.html +20 -260
  102. data/lib/zendesk_api/server/public/doc/file_list.html +1 -1
  103. data/lib/zendesk_api/server/public/doc/frames.html +1 -1
  104. data/lib/zendesk_api/server/public/doc/index.html +20 -260
  105. data/lib/zendesk_api/server/public/doc/method_list.html +309 -517
  106. data/lib/zendesk_api/server/public/doc/top-level-namespace.html +3 -35
  107. data/lib/zendesk_api/verbs.rb +0 -4
  108. data/lib/zendesk_api/version.rb +1 -1
  109. data/spec/core/client_spec.rb +53 -13
  110. data/spec/core/collection_spec.rb +32 -4
  111. data/spec/core/create_resource_spec.rb +1 -1
  112. data/spec/core/data_resource_spec.rb +2 -2
  113. data/spec/core/middleware/request/etag_cache_spec.rb +6 -7
  114. data/spec/core/middleware/request/upload_spec.rb +2 -10
  115. data/spec/core/middleware/response/callback_spec.rb +1 -1
  116. data/spec/core/middleware/response/raise_error_spec.rb +40 -0
  117. data/spec/core/read_resource_spec.rb +0 -2
  118. data/spec/core/resource_spec.rb +13 -5
  119. data/spec/core/search_spec.rb +1 -1
  120. data/spec/core/spec_helper.rb +3 -3
  121. data/spec/live/automation_spec.rb +23 -0
  122. data/spec/live/organization_field_spec.rb +12 -0
  123. data/spec/live/ticket_spec.rb +8 -2
  124. data/spec/live/trigger_spec.rb +23 -0
  125. data/spec/live/user_field_spec.rb +12 -0
  126. data/spec/live/user_spec.rb +0 -2
  127. data/spec/live/view_spec.rb +17 -1
  128. data/spec/server/spec_helper.rb +2 -2
  129. data/zendesk_api.gemspec +1 -1
  130. metadata +88 -51
  131. checksums.yaml +0 -7
  132. data/lib/zendesk_api/rescue.rb +0 -63
  133. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Console.html +0 -860
  134. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Console/Eval.html +0 -190
  135. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Server.html +0 -131
  136. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Server/App.html +0 -523
  137. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Server/Helper.html +0 -684
  138. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Server/HtmlRenderer.html +0 -303
  139. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Server/HtmlRenderer/RedcarpetRenderer.html +0 -508
  140. data/lib/zendesk_api/server/public/doc/ZendeskAPI/Server/ZlibJSON.html +0 -244
  141. data/spec/core/rescue_spec.rb +0 -151
@@ -1,303 +0,0 @@
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
- Class: ZendeskAPI::Server::HtmlRenderer
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">HtmlRenderer</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>Class: ZendeskAPI::Server::HtmlRenderer
67
-
68
-
69
-
70
- </h1>
71
-
72
- <dl class="box">
73
-
74
- <dt class="r1">Inherits:</dt>
75
- <dd class="r1">
76
- <span class="inheritName">Object</span>
77
-
78
- <ul class="fullTree">
79
- <li>Object</li>
80
-
81
- <li class="next">ZendeskAPI::Server::HtmlRenderer</li>
82
-
83
- </ul>
84
- <a href="#" class="inheritanceTree">show all</a>
85
-
86
- </dd>
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
- <dt class="r2 last">Defined in:</dt>
97
- <dd class="r2 last">lib/zendesk_api/server/html_renderer.rb</dd>
98
-
99
- </dl>
100
- <div class="clear"></div>
101
-
102
- <h2>Defined Under Namespace</h2>
103
- <p class="children">
104
-
105
-
106
-
107
-
108
- <strong class="classes">Classes:</strong> <span class='object_link'><a href="HtmlRenderer/RedcarpetRenderer.html" title="ZendeskAPI::Server::HtmlRenderer::RedcarpetRenderer (class)">RedcarpetRenderer</a></span>
109
-
110
-
111
- </p>
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
- <h2>
121
- Class Method Summary
122
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
123
- </h2>
124
-
125
- <ul class="summary">
126
-
127
- <li class="public ">
128
- <span class="summary_signature">
129
-
130
- <a href="#generate_id-class_method" title="generate_id (class method)">+ (Object) <strong>generate_id</strong>(text) </a>
131
-
132
-
133
-
134
- </span>
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
- <span class="summary_desc"><div class='inline'></div></span>
145
-
146
- </li>
147
-
148
-
149
- <li class="public ">
150
- <span class="summary_signature">
151
-
152
- <a href="#markdown-class_method" title="markdown (class method)">+ (Object) <strong>markdown</strong> </a>
153
-
154
-
155
-
156
- </span>
157
-
158
-
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
- <span class="summary_desc"><div class='inline'></div></span>
167
-
168
- </li>
169
-
170
-
171
- <li class="public ">
172
- <span class="summary_signature">
173
-
174
- <a href="#render-class_method" title="render (class method)">+ (Object) <strong>render</strong>(text) </a>
175
-
176
-
177
-
178
- </span>
179
-
180
-
181
-
182
-
183
-
184
-
185
-
186
-
187
-
188
- <span class="summary_desc"><div class='inline'></div></span>
189
-
190
- </li>
191
-
192
-
193
- </ul>
194
-
195
-
196
-
197
-
198
- <div id="class_method_details" class="method_details_list">
199
- <h2>Class Method Details</h2>
200
-
201
-
202
- <div class="method_details first">
203
- <h3 class="signature first" id="generate_id-class_method">
204
-
205
- + (<tt>Object</tt>) <strong>generate_id</strong>(text)
206
-
207
-
208
-
209
-
210
-
211
- </h3><table class="source_code">
212
- <tr>
213
- <td>
214
- <pre class="lines">
215
-
216
-
217
- 13
218
- 14
219
- 15</pre>
220
- </td>
221
- <td>
222
- <pre class="code"><span class="info file"># File 'lib/zendesk_api/server/html_renderer.rb', line 13</span>
223
-
224
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_generate_id'>generate_id</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
225
- <span class='id identifier rubyid_text'>text</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[\s,]+</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
226
- <span class='kw'>end</span></pre>
227
- </td>
228
- </tr>
229
- </table>
230
- </div>
231
-
232
- <div class="method_details ">
233
- <h3 class="signature " id="markdown-class_method">
234
-
235
- + (<tt>Object</tt>) <strong>markdown</strong>
236
-
237
-
238
-
239
-
240
-
241
- </h3><table class="source_code">
242
- <tr>
243
- <td>
244
- <pre class="lines">
245
-
246
-
247
- 5
248
- 6
249
- 7</pre>
250
- </td>
251
- <td>
252
- <pre class="code"><span class="info file"># File 'lib/zendesk_api/server/html_renderer.rb', line 5</span>
253
-
254
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_markdown'>markdown</span>
255
- <span class='ivar'>@markdown</span> <span class='op'>||=</span> <span class='const'>Redcarpet</span><span class='op'>::</span><span class='const'>Markdown</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>RedcarpetRenderer</span><span class='comma'>,</span> <span class='symbol'>:fenced_code_blocks</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:no_intra_emphasis</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:tables</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='rparen'>)</span>
256
- <span class='kw'>end</span></pre>
257
- </td>
258
- </tr>
259
- </table>
260
- </div>
261
-
262
- <div class="method_details ">
263
- <h3 class="signature " id="render-class_method">
264
-
265
- + (<tt>Object</tt>) <strong>render</strong>(text)
266
-
267
-
268
-
269
-
270
-
271
- </h3><table class="source_code">
272
- <tr>
273
- <td>
274
- <pre class="lines">
275
-
276
-
277
- 9
278
- 10
279
- 11</pre>
280
- </td>
281
- <td>
282
- <pre class="code"><span class="info file"># File 'lib/zendesk_api/server/html_renderer.rb', line 9</span>
283
-
284
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
285
- <span class='id identifier rubyid_markdown'>markdown</span><span class='period'>.</span><span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
286
- <span class='kw'>end</span></pre>
287
- </td>
288
- </tr>
289
- </table>
290
- </div>
291
-
292
- </div>
293
-
294
- </div>
295
-
296
- <div id="footer">
297
- Generated on Mon Feb 11 17:45:41 2013 by
298
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
299
- 0.8.4.1 (ruby-1.9.3).
300
- </div>
301
-
302
- </body>
303
- </html>
@@ -1,508 +0,0 @@
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
- Class: ZendeskAPI::Server::HtmlRenderer::RedcarpetRenderer
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 (R)</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> &raquo; <span class='title'><span class='object_link'><a href="../HtmlRenderer.html" title="ZendeskAPI::Server::HtmlRenderer (class)">HtmlRenderer</a></span></span>
36
- &raquo;
37
- <span class="title">RedcarpetRenderer</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>Class: ZendeskAPI::Server::HtmlRenderer::RedcarpetRenderer
67
-
68
-
69
-
70
- </h1>
71
-
72
- <dl class="box">
73
-
74
- <dt class="r1">Inherits:</dt>
75
- <dd class="r1">
76
- <span class="inheritName">Redcarpet::Render::HTML</span>
77
-
78
- <ul class="fullTree">
79
- <li>Object</li>
80
-
81
- <li class="next">Redcarpet::Render::HTML</li>
82
-
83
- <li class="next">ZendeskAPI::Server::HtmlRenderer::RedcarpetRenderer</li>
84
-
85
- </ul>
86
- <a href="#" class="inheritanceTree">show all</a>
87
-
88
- </dd>
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
- <dt class="r2 last">Defined in:</dt>
99
- <dd class="r2 last">lib/zendesk_api/server/html_renderer.rb</dd>
100
-
101
- </dl>
102
- <div class="clear"></div>
103
-
104
-
105
-
106
-
107
-
108
- <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
109
- <ul class="summary">
110
-
111
- <li class="public ">
112
- <span class="summary_signature">
113
-
114
- <a href="#headers-instance_method" title="#headers (instance method)">- (Object) <strong>headers</strong> </a>
115
-
116
-
117
-
118
- </span>
119
-
120
-
121
-
122
-
123
- <span class="note title readonly">readonly</span>
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
-
133
- <span class="summary_desc"><div class='inline'>
134
- <p>Returns the value of attribute headers.</p>
135
- </div></span>
136
-
137
- </li>
138
-
139
-
140
- </ul>
141
-
142
-
143
-
144
-
145
-
146
- <h2>
147
- Instance Method Summary
148
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
149
- </h2>
150
-
151
- <ul class="summary">
152
-
153
- <li class="public ">
154
- <span class="summary_signature">
155
-
156
- <a href="#block_code-instance_method" title="#block_code (instance method)">- (Object) <strong>block_code</strong>(code, language) </a>
157
-
158
-
159
-
160
- </span>
161
-
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
- <span class="summary_desc"><div class='inline'></div></span>
171
-
172
- </li>
173
-
174
-
175
- <li class="public ">
176
- <span class="summary_signature">
177
-
178
- <a href="#header-instance_method" title="#header (instance method)">- (Object) <strong>header</strong>(text, level) </a>
179
-
180
-
181
-
182
- </span>
183
-
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
-
192
- <span class="summary_desc"><div class='inline'></div></span>
193
-
194
- </li>
195
-
196
-
197
- <li class="public ">
198
- <span class="summary_signature">
199
-
200
- <a href="#icons-instance_method" title="#icons (instance method)">- (Object) <strong>icons</strong> </a>
201
-
202
-
203
-
204
- </span>
205
-
206
-
207
-
208
-
209
-
210
-
211
-
212
-
213
-
214
- <span class="summary_desc"><div class='inline'></div></span>
215
-
216
- </li>
217
-
218
-
219
- </ul>
220
-
221
-
222
-
223
-
224
- <div id="instance_attr_details" class="attr_details">
225
- <h2>Instance Attribute Details</h2>
226
-
227
-
228
- <span id=""></span>
229
- <div class="method_details first">
230
- <h3 class="signature first" id="headers-instance_method">
231
-
232
- - (<tt>Object</tt>) <strong>headers</strong> <span class="extras">(readonly)</span>
233
-
234
-
235
-
236
-
237
-
238
- </h3><div class="docstring">
239
- <div class="discussion">
240
-
241
- <p>Returns the value of attribute headers</p>
242
-
243
-
244
- </div>
245
- </div>
246
- <div class="tags">
247
-
248
-
249
- </div><table class="source_code">
250
- <tr>
251
- <td>
252
- <pre class="lines">
253
-
254
-
255
- 18
256
- 19
257
- 20</pre>
258
- </td>
259
- <td>
260
- <pre class="code"><span class="info file"># File 'lib/zendesk_api/server/html_renderer.rb', line 18</span>
261
-
262
- <span class='kw'>def</span> <span class='id identifier rubyid_headers'>headers</span>
263
- <span class='ivar'>@headers</span>
264
- <span class='kw'>end</span></pre>
265
- </td>
266
- </tr>
267
- </table>
268
- </div>
269
-
270
- </div>
271
-
272
-
273
- <div id="instance_method_details" class="method_details_list">
274
- <h2>Instance Method Details</h2>
275
-
276
-
277
- <div class="method_details first">
278
- <h3 class="signature first" id="block_code-instance_method">
279
-
280
- - (<tt>Object</tt>) <strong>block_code</strong>(code, language)
281
-
282
-
283
-
284
-
285
-
286
- </h3><table class="source_code">
287
- <tr>
288
- <td>
289
- <pre class="lines">
290
-
291
-
292
- 40
293
- 41
294
- 42
295
- 43
296
- 44
297
- 45
298
- 46
299
- 47
300
- 48
301
- 49
302
- 50
303
- 51
304
- 52
305
- 53
306
- 54
307
- 55
308
- 56
309
- 57
310
- 58
311
- 59
312
- 60
313
- 61
314
- 62
315
- 63
316
- 64
317
- 65
318
- 66
319
- 67
320
- 68
321
- 69
322
- 70
323
- 71
324
- 72
325
- 73
326
- 74
327
- 75
328
- 76
329
- 77
330
- 78
331
- 79
332
- 80
333
- 81
334
- 82
335
- 83
336
- 84
337
- 85
338
- 86
339
- 87
340
- 88
341
- 89
342
- 90
343
- 91
344
- 92
345
- 93
346
- 94
347
- 95</pre>
348
- </td>
349
- <td>
350
- <pre class="code"><span class="info file"># File 'lib/zendesk_api/server/html_renderer.rb', line 40</span>
351
-
352
- <span class='kw'>def</span> <span class='id identifier rubyid_block_code'>block_code</span><span class='lparen'>(</span><span class='id identifier rubyid_code'>code</span><span class='comma'>,</span> <span class='id identifier rubyid_language'>language</span><span class='rparen'>)</span>
353
- <span class='comment'># CodeRay doesn't know HTTP
354
- </span> <span class='id identifier rubyid_language'>language</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>json</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_language'>language</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>
355
-
356
- <span class='id identifier rubyid_mod'>mod</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
357
-
358
- <span class='id identifier rubyid_json'>json</span> <span class='op'>=</span> <span class='kw'>nil</span>
359
-
360
- <span class='kw'>if</span> <span class='id identifier rubyid_language'>language</span>
361
- <span class='kw'>if</span> <span class='id identifier rubyid_code'>code</span><span class='period'>.</span><span class='id identifier rubyid_start_with?'>start_with?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>curl</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
362
- <span class='kw'>if</span> <span class='id identifier rubyid_code'>code</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>%r[</span><span class='tstring_content'>(https://{subdomain}.zendesk.com/api/v2/.*.json(\?(\w+={.+})+ )?)</span><span class='regexp_end'>]</span></span>
363
- <span class='id identifier rubyid_example'>example</span> <span class='op'>=</span> <span class='kw'>true</span>
364
-
365
- <span class='id identifier rubyid_mod'>mod</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>class</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'>example</span><span class='tstring_end'>&quot;</span></span>
366
- <span class='id identifier rubyid_mod'>mod</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>data-url</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='backref'>$1</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span>
367
-
368
- <span class='comment'># This grabs the -d parameter
369
- </span> <span class='comment'># ...
370
- </span> <span class='kw'>if</span> <span class='id identifier rubyid_code'>code</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> -d </span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
371
- <span class='id identifier rubyid_str_begin'>str_begin</span> <span class='op'>=</span> <span class='id identifier rubyid_code'>code</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>['&quot;]</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='id identifier rubyid_code'>code</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> -d </span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
372
-
373
- <span class='id identifier rubyid_chars'>chars</span> <span class='op'>=</span> <span class='id identifier rubyid_code'>code</span><span class='lbracket'>[</span><span class='id identifier rubyid_str_begin'>str_begin</span><span class='op'>..</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_chars'>chars</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span>
374
- <span class='id identifier rubyid_str_end'>str_end</span> <span class='op'>=</span> <span class='kw'>nil</span>
375
-
376
- <span class='id identifier rubyid_chars'>chars</span><span class='lbracket'>[</span><span class='int'>1</span><span class='op'>..</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_char'>char</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
377
- <span class='kw'>if</span> <span class='id identifier rubyid_char'>char</span> <span class='op'>==</span> <span class='id identifier rubyid_chars'>chars</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_chars'>chars</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span> <span class='op'>-</span> <span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\\</span><span class='tstring_end'>&quot;</span></span>
378
- <span class='id identifier rubyid_str_end'>str_end</span> <span class='op'>=</span> <span class='id identifier rubyid_i'>i</span>
379
- <span class='kw'>break</span>
380
- <span class='kw'>end</span>
381
- <span class='kw'>end</span>
382
-
383
- <span class='id identifier rubyid_mod'>mod</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>data-json</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_code'>code</span><span class='period'>.</span><span class='id identifier rubyid_slice'>slice</span><span class='lparen'>(</span><span class='id identifier rubyid_str_begin'>str_begin</span> <span class='op'>+</span> <span class='int'>1</span><span class='op'>..</span><span class='lparen'>(</span><span class='id identifier rubyid_str_begin'>str_begin</span> <span class='op'>+</span> <span class='id identifier rubyid_str_end'>str_end</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_str_end'>str_end</span>
384
- <span class='kw'>end</span>
385
-
386
- <span class='kw'>if</span> <span class='id identifier rubyid_code'>code</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>-X (PUT|POST|GET|DELETE)</span><span class='regexp_end'>/</span></span>
387
- <span class='id identifier rubyid_mod'>mod</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>data-method</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='backref'>$1</span>
388
- <span class='kw'>end</span>
389
- <span class='kw'>end</span>
390
- <span class='kw'>end</span>
391
-
392
- <span class='id identifier rubyid_code'>code</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='id identifier rubyid_code'>code</span><span class='comma'>,</span> <span class='id identifier rubyid_language'>language</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_html'>html</span><span class='lparen'>(</span><span class='symbol'>:wrap</span> <span class='op'>=&gt;</span> <span class='kw'>nil</span><span class='rparen'>)</span>
393
- <span class='kw'>end</span>
394
-
395
- <span class='id identifier rubyid_mod'>mod</span> <span class='op'>=</span> <span class='id identifier rubyid_mod'>mod</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_str'>str</span><span class='comma'>,</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='rparen'>)</span><span class='op'>|</span> <span class='id identifier rubyid_str'>str</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_k'>k</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_content'>'</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='rbrace'>}</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>
396
-
397
- <span class='kw'>if</span> <span class='id identifier rubyid_example'>example</span>
398
- <span class='heredoc_beg'>&lt;&lt;-END</span>
399
- <span class='tstring_content'> &lt;button class=&quot;btn example&quot; title=&quot;Fill in the form with this example&quot;&gt;
400
- &lt;i class=&quot;icon icon-pencil&quot;&gt;&lt;/i&gt;
401
- &lt;/button&gt;
402
- &lt;pre </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_mod'>mod</span><span class='rbrace'>}</span><span class='tstring_content'>&gt;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_code'>code</span><span class='rbrace'>}</span><span class='tstring_content'>&lt;/pre&gt;
403
- </span><span class='heredoc_end'> END
404
- </span> <span class='kw'>else</span>
405
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;pre&gt;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_code'>code</span><span class='rbrace'>}</span><span class='tstring_content'>&lt;/pre&gt;</span><span class='tstring_end'>&quot;</span></span>
406
- <span class='kw'>end</span>
407
- <span class='kw'>end</span></pre>
408
- </td>
409
- </tr>
410
- </table>
411
- </div>
412
-
413
- <div class="method_details ">
414
- <h3 class="signature " id="header-instance_method">
415
-
416
- - (<tt>Object</tt>) <strong>header</strong>(text, level)
417
-
418
-
419
-
420
-
421
-
422
- </h3><table class="source_code">
423
- <tr>
424
- <td>
425
- <pre class="lines">
426
-
427
-
428
- 27
429
- 28
430
- 29
431
- 30
432
- 31
433
- 32
434
- 33
435
- 34
436
- 35
437
- 36
438
- 37
439
- 38</pre>
440
- </td>
441
- <td>
442
- <pre class="code"><span class="info file"># File 'lib/zendesk_api/server/html_renderer.rb', line 27</span>
443
-
444
- <span class='kw'>def</span> <span class='id identifier rubyid_header'>header</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='comma'>,</span> <span class='id identifier rubyid_level'>level</span><span class='rparen'>)</span>
445
- <span class='id identifier rubyid_top_level'>top_level</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span> <span class='int'>3</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_level'>level</span><span class='rparen'>)</span>
446
- <span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='const'>HtmlRenderer</span><span class='period'>.</span><span class='id identifier rubyid_generate_id'>generate_id</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
447
-
448
- <span class='ivar'>@headers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
449
- <span class='ivar'>@headers</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_top_level'>top_level</span>
450
-
451
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;h</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_level'>level</span><span class='rbrace'>}</span><span class='tstring_content'> id=\&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='tstring_content'>\&quot;&gt;
452
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_icons'>icons</span> <span class='kw'>if</span> <span class='id identifier rubyid_top_level'>top_level</span><span class='rbrace'>}</span><span class='tstring_content'>
453
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_text'>text</span><span class='rbrace'>}</span><span class='tstring_content'>
454
- &lt;/h</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_level'>level</span><span class='rbrace'>}</span><span class='tstring_content'>&gt;</span><span class='tstring_end'>&quot;</span></span>
455
- <span class='kw'>end</span></pre>
456
- </td>
457
- </tr>
458
- </table>
459
- </div>
460
-
461
- <div class="method_details ">
462
- <h3 class="signature " id="icons-instance_method">
463
-
464
- - (<tt>Object</tt>) <strong>icons</strong>
465
-
466
-
467
-
468
-
469
-
470
- </h3><table class="source_code">
471
- <tr>
472
- <td>
473
- <pre class="lines">
474
-
475
-
476
- 20
477
- 21
478
- 22
479
- 23
480
- 24
481
- 25</pre>
482
- </td>
483
- <td>
484
- <pre class="code"><span class="info file"># File 'lib/zendesk_api/server/html_renderer.rb', line 20</span>
485
-
486
- <span class='kw'>def</span> <span class='id identifier rubyid_icons'>icons</span>
487
- <span class='heredoc_beg'>&lt;&lt;-END</span>
488
- <span class='tstring_content'> &lt;i class=\&quot;header-icon icon-plus\&quot;&gt;&lt;/i&gt;
489
- &lt;i class=\&quot;header-icon icon-minus hide\&quot;&gt;&lt;/i&gt;
490
- </span><span class='heredoc_end'> END
491
- </span><span class='kw'>end</span></pre>
492
- </td>
493
- </tr>
494
- </table>
495
- </div>
496
-
497
- </div>
498
-
499
- </div>
500
-
501
- <div id="footer">
502
- Generated on Mon Feb 11 17:45:41 2013 by
503
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
504
- 0.8.4.1 (ruby-1.9.3).
505
- </div>
506
-
507
- </body>
508
- </html>