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,510 @@
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::Save
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 (S)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../ZendeskAPI.html" title="ZendeskAPI (module)">ZendeskAPI</a></span></span>
36
+ &raquo;
37
+ <span class="title">Save</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::Save
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+ <dt class="r1">Included in:</dt>
81
+ <dd class="r1"><span class='object_link'><a href="Create.html" title="ZendeskAPI::Create (module)">Create</a></span>, <span class='object_link'><a href="Ticket/Comment.html" title="ZendeskAPI::Ticket::Comment (class)">Ticket::Comment</a></span>, <span class='object_link'><a href="Update.html" title="ZendeskAPI::Update (module)">Update</a></span></dd>
82
+
83
+
84
+
85
+ <dt class="r2 last">Defined in:</dt>
86
+ <dd class="r2 last">lib/zendesk_api/actions.rb</dd>
87
+
88
+ </dl>
89
+ <div class="clear"></div>
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+ <h2>
100
+ Instance Method Summary
101
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
102
+ </h2>
103
+
104
+ <ul class="summary">
105
+
106
+ <li class="public ">
107
+ <span class="summary_signature">
108
+
109
+ <a href="#clear_associations-instance_method" title="#clear_associations (instance method)">- (Object) <strong>clear_associations</strong> </a>
110
+
111
+
112
+
113
+ </span>
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ <span class="summary_desc"><div class='inline'>
124
+ <p>Removes all cached associations.</p>
125
+ </div></span>
126
+
127
+ </li>
128
+
129
+
130
+ <li class="public ">
131
+ <span class="summary_signature">
132
+
133
+ <a href="#save-instance_method" title="#save (instance method)">- (Boolean) <strong>save</strong>(options = {}) </a>
134
+
135
+
136
+
137
+ </span>
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+ <span class="summary_desc"><div class='inline'>
148
+ <p>If this resource hasn't been deleted, then create or save it.</p>
149
+ </div></span>
150
+
151
+ </li>
152
+
153
+
154
+ <li class="public ">
155
+ <span class="summary_signature">
156
+
157
+ <a href="#save%21-instance_method" title="#save! (instance method)">- (Object) <strong>save!</strong>(options = {}) </a>
158
+
159
+
160
+
161
+ </span>
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ <span class="summary_desc"><div class='inline'>
172
+ <p>Saves, raising an Argument error if it fails.</p>
173
+ </div></span>
174
+
175
+ </li>
176
+
177
+
178
+ <li class="public ">
179
+ <span class="summary_signature">
180
+
181
+ <a href="#save_associations-instance_method" title="#save_associations (instance method)">- (Object) <strong>save_associations</strong> </a>
182
+
183
+
184
+
185
+ </span>
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+ <span class="summary_desc"><div class='inline'>
196
+ <p>Saves associations Takes into account inlining, collections, and id setting
197
+ on the parent resource.</p>
198
+ </div></span>
199
+
200
+ </li>
201
+
202
+
203
+ </ul>
204
+
205
+
206
+
207
+
208
+ <div id="instance_method_details" class="method_details_list">
209
+ <h2>Instance Method Details</h2>
210
+
211
+
212
+ <div class="method_details first">
213
+ <h3 class="signature first" id="clear_associations-instance_method">
214
+
215
+ - (<tt>Object</tt>) <strong>clear_associations</strong>
216
+
217
+
218
+
219
+
220
+
221
+ </h3><div class="docstring">
222
+ <div class="discussion">
223
+
224
+ <p>Removes all cached associations</p>
225
+
226
+
227
+ </div>
228
+ </div>
229
+ <div class="tags">
230
+
231
+
232
+ </div><table class="source_code">
233
+ <tr>
234
+ <td>
235
+ <pre class="lines">
236
+
237
+
238
+ 43
239
+ 44
240
+ 45
241
+ 46
242
+ 47
243
+ 48</pre>
244
+ </td>
245
+ <td>
246
+ <pre class="code"><span class="info file"># File 'lib/zendesk_api/actions.rb', line 43</span>
247
+
248
+ <span class='kw'>def</span> <span class='id identifier rubyid_clear_associations'>clear_associations</span>
249
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_associations'>associations</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_association_data'>association_data</span><span class='op'>|</span>
250
+ <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_association_data'>association_data</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span>
251
+ <span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_instance_variable_defined?'>instance_variable_defined?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
252
+ <span class='kw'>end</span>
253
+ <span class='kw'>end</span></pre>
254
+ </td>
255
+ </tr>
256
+ </table>
257
+ </div>
258
+
259
+ <div class="method_details ">
260
+ <h3 class="signature " id="save-instance_method">
261
+
262
+ - (<tt>Boolean</tt>) <strong>save</strong>(options = {})
263
+
264
+
265
+
266
+
267
+
268
+ </h3><div class="docstring">
269
+ <div class="discussion">
270
+
271
+ <p>If this resource hasn't been deleted, then create or save it. Executes a
272
+ POST if it is a <span class='object_link'><a href="Data.html#new_record%3F-instance_method" title="ZendeskAPI::Data#new_record? (method)">Data#new_record?</a></span>, otherwise a PUT. Merges returned
273
+ attributes on success.</p>
274
+
275
+
276
+ </div>
277
+ </div>
278
+ <div class="tags">
279
+
280
+ <p class="tag_title">Returns:</p>
281
+ <ul class="return">
282
+
283
+ <li>
284
+
285
+
286
+ <span class='type'>(<tt>Boolean</tt>)</span>
287
+
288
+
289
+
290
+ &mdash;
291
+ <div class='inline'>
292
+ <p>Success?</p>
293
+ </div>
294
+
295
+ </li>
296
+
297
+ </ul>
298
+
299
+ </div><table class="source_code">
300
+ <tr>
301
+ <td>
302
+ <pre class="lines">
303
+
304
+
305
+ 7
306
+ 8
307
+ 9
308
+ 10
309
+ 11
310
+ 12
311
+ 13
312
+ 14
313
+ 15
314
+ 16
315
+ 17
316
+ 18
317
+ 19
318
+ 20
319
+ 21
320
+ 22
321
+ 23
322
+ 24
323
+ 25
324
+ 26
325
+ 27
326
+ 28
327
+ 29
328
+ 30
329
+ 31
330
+ 32
331
+ 33
332
+ 34</pre>
333
+ </td>
334
+ <td>
335
+ <pre class="code"><span class="info file"># File 'lib/zendesk_api/actions.rb', line 7</span>
336
+
337
+ <span class='kw'>def</span> <span class='id identifier rubyid_save'>save</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
338
+ <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:destroyed?</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_destroyed?'>destroyed?</span>
339
+
340
+ <span class='kw'>if</span> <span class='id identifier rubyid_new_record?'>new_record?</span>
341
+ <span class='id identifier rubyid_method'>method</span> <span class='op'>=</span> <span class='symbol'>:post</span>
342
+ <span class='id identifier rubyid_req_path'>req_path</span> <span class='op'>=</span> <span class='id identifier rubyid_path'>path</span>
343
+ <span class='kw'>else</span>
344
+ <span class='id identifier rubyid_method'>method</span> <span class='op'>=</span> <span class='symbol'>:put</span>
345
+ <span class='id identifier rubyid_req_path'>req_path</span> <span class='op'>=</span> <span class='id identifier rubyid_url'>url</span> <span class='op'>||</span> <span class='id identifier rubyid_path'>path</span>
346
+ <span class='kw'>end</span>
347
+
348
+ <span class='id identifier rubyid_req_path'>req_path</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:path</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:path</span><span class='rbracket'>]</span>
349
+
350
+ <span class='id identifier rubyid_save_associations'>save_associations</span>
351
+
352
+ <span class='ivar'>@response</span> <span class='op'>=</span> <span class='ivar'>@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='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_req_path'>req_path</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_req'>req</span><span class='op'>|</span>
353
+ <span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_unnested_params'>unnested_params</span>
354
+ <span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_changes'>changes</span>
355
+ <span class='kw'>else</span>
356
+ <span class='lbrace'>{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_singular_resource_name'>singular_resource_name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_changes'>changes</span><span class='rbrace'>}</span>
357
+ <span class='kw'>end</span>
358
+ <span class='kw'>end</span>
359
+
360
+ <span class='ivar'>@attributes</span><span class='period'>.</span><span class='id identifier rubyid_replace'>replace</span> <span class='ivar'>@attributes</span><span class='period'>.</span><span class='id identifier rubyid_deep_merge'>deep_merge</span><span class='lparen'>(</span><span class='ivar'>@response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_singular_resource_name'>singular_resource_name</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
361
+ <span class='ivar'>@attributes</span><span class='period'>.</span><span class='id identifier rubyid_clear_changes'>clear_changes</span>
362
+ <span class='id identifier rubyid_clear_associations'>clear_associations</span>
363
+ <span class='kw'>true</span>
364
+ <span class='kw'>end</span></pre>
365
+ </td>
366
+ </tr>
367
+ </table>
368
+ </div>
369
+
370
+ <div class="method_details ">
371
+ <h3 class="signature " id="save!-instance_method">
372
+
373
+ - (<tt>Object</tt>) <strong>save!</strong>(options = {})
374
+
375
+
376
+
377
+
378
+
379
+ </h3><div class="docstring">
380
+ <div class="discussion">
381
+
382
+ <p>Saves, raising an Argument error if it fails</p>
383
+
384
+
385
+ </div>
386
+ </div>
387
+ <div class="tags">
388
+
389
+ <p class="tag_title">Raises:</p>
390
+ <ul class="raise">
391
+
392
+ <li>
393
+
394
+
395
+ <span class='type'>(<tt>ArgumentError</tt>)</span>
396
+
397
+
398
+
399
+ &mdash;
400
+ <div class='inline'>
401
+ <p>if saving failed</p>
402
+ </div>
403
+
404
+ </li>
405
+
406
+ </ul>
407
+
408
+ </div><table class="source_code">
409
+ <tr>
410
+ <td>
411
+ <pre class="lines">
412
+
413
+
414
+ 38
415
+ 39
416
+ 40</pre>
417
+ </td>
418
+ <td>
419
+ <pre class="code"><span class="info file"># File 'lib/zendesk_api/actions.rb', line 38</span>
420
+
421
+ <span class='kw'>def</span> <span class='id identifier rubyid_save!'>save!</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
422
+ <span class='id identifier rubyid_save'>save</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Save failed</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
423
+ <span class='kw'>end</span></pre>
424
+ </td>
425
+ </tr>
426
+ </table>
427
+ </div>
428
+
429
+ <div class="method_details ">
430
+ <h3 class="signature " id="save_associations-instance_method">
431
+
432
+ - (<tt>Object</tt>) <strong>save_associations</strong>
433
+
434
+
435
+
436
+
437
+
438
+ </h3><div class="docstring">
439
+ <div class="discussion">
440
+
441
+ <p>Saves associations Takes into account inlining, collections, and id setting
442
+ on the parent resource.</p>
443
+
444
+
445
+ </div>
446
+ </div>
447
+ <div class="tags">
448
+
449
+
450
+ </div><table class="source_code">
451
+ <tr>
452
+ <td>
453
+ <pre class="lines">
454
+
455
+
456
+ 52
457
+ 53
458
+ 54
459
+ 55
460
+ 56
461
+ 57
462
+ 58
463
+ 59
464
+ 60
465
+ 61
466
+ 62
467
+ 63
468
+ 64
469
+ 65
470
+ 66
471
+ 67
472
+ 68</pre>
473
+ </td>
474
+ <td>
475
+ <pre class="code"><span class="info file"># File 'lib/zendesk_api/actions.rb', line 52</span>
476
+
477
+ <span class='kw'>def</span> <span class='id identifier rubyid_save_associations'>save_associations</span>
478
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_associations'>associations</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_association_data'>association_data</span><span class='op'>|</span>
479
+ <span class='id identifier rubyid_association_name'>association_name</span> <span class='op'>=</span> <span class='id identifier rubyid_association_data'>association_data</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span>
480
+ <span class='kw'>next</span> <span class='kw'>unless</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_association_name'>association_name</span><span class='rbrace'>}</span><span class='tstring_content'>_used?</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_association'>association</span> <span class='op'>=</span> <span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_association_name'>association_name</span><span class='rparen'>)</span>
481
+
482
+ <span class='id identifier rubyid_inline_creation'>inline_creation</span> <span class='op'>=</span> <span class='id identifier rubyid_association_data'>association_data</span><span class='lbracket'>[</span><span class='symbol'>:inline</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='symbol'>:create</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_new_record?'>new_record?</span>
483
+ <span class='id identifier rubyid_changed'>changed</span> <span class='op'>=</span> <span class='id identifier rubyid_association'>association</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Collection</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='op'>!</span><span class='id identifier rubyid_association'>association</span><span class='period'>.</span><span class='id identifier rubyid_changes'>changes</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
484
+
485
+ <span class='kw'>if</span> <span class='id identifier rubyid_association'>association</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:save</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_changed'>changed</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='id identifier rubyid_inline_creation'>inline_creation</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_association'>association</span><span class='period'>.</span><span class='id identifier rubyid_save'>save</span>
486
+ <span class='kw'>self</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_association_name'>association_name</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_association'>association</span><span class='rparen'>)</span> <span class='comment'># set id/ids columns
487
+ </span> <span class='kw'>end</span>
488
+
489
+ <span class='kw'>if</span> <span class='id identifier rubyid_association_data'>association_data</span><span class='lbracket'>[</span><span class='symbol'>:inline</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='kw'>true</span> <span class='op'>||</span> <span class='id identifier rubyid_inline_creation'>inline_creation</span>
490
+ <span class='id identifier rubyid_attributes'>attributes</span><span class='lbracket'>[</span><span class='id identifier rubyid_association_name'>association_name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_association'>association</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Collection</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_association'>association</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'>:to_param</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_association'>association</span><span class='period'>.</span><span class='id identifier rubyid_to_param'>to_param</span><span class='rparen'>)</span>
491
+ <span class='kw'>end</span>
492
+ <span class='kw'>end</span>
493
+ <span class='kw'>end</span></pre>
494
+ </td>
495
+ </tr>
496
+ </table>
497
+ </div>
498
+
499
+ </div>
500
+
501
+ </div>
502
+
503
+ <div id="footer">
504
+ Generated on Mon Feb 11 17:45:36 2013 by
505
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
506
+ 0.8.4.1 (ruby-1.9.3).
507
+ </div>
508
+
509
+ </body>
510
+ </html>