pipedrive_ruby 1.0.1.pre15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. checksums.yaml +7 -0
  2. data/.codeclimate.yml +30 -0
  3. data/.gitignore +12 -0
  4. data/.rspec +2 -0
  5. data/.rubocop.yml +1156 -0
  6. data/.travis.yml +8 -0
  7. data/CODE_OF_CONDUCT.md +49 -0
  8. data/Gemfile +4 -0
  9. data/Guardfile +56 -0
  10. data/LICENSE.txt +21 -0
  11. data/README.md +59 -0
  12. data/Rakefile +6 -0
  13. data/bin/console +14 -0
  14. data/bin/setup +8 -0
  15. data/doc/Activities.html +138 -0
  16. data/doc/ActivitiesFields.html +134 -0
  17. data/doc/ActivitiesTypes.html +141 -0
  18. data/doc/Authorizations.html +138 -0
  19. data/doc/Currencies.html +143 -0
  20. data/doc/DealsFields.html +146 -0
  21. data/doc/EmailMessages.html +137 -0
  22. data/doc/EmailThreads.html +136 -0
  23. data/doc/Estages.html +137 -0
  24. data/doc/Files.html +139 -0
  25. data/doc/Filters.html +139 -0
  26. data/doc/GlobalMessages.html +134 -0
  27. data/doc/Goals.html +137 -0
  28. data/doc/NoteFields.html +134 -0
  29. data/doc/Notes.html +137 -0
  30. data/doc/OrganizationFields.html +147 -0
  31. data/doc/OrganizationRelationships.html +135 -0
  32. data/doc/PermissionSets.html +134 -0
  33. data/doc/PersonFields.html +146 -0
  34. data/doc/Persons.html +136 -0
  35. data/doc/PipedriveRuby/Activities.html +159 -0
  36. data/doc/PipedriveRuby/ActivitiesFields.html +148 -0
  37. data/doc/PipedriveRuby/ActivitiesTypes.html +148 -0
  38. data/doc/PipedriveRuby/ActivityFields.html +148 -0
  39. data/doc/PipedriveRuby/ActivityTypes.html +148 -0
  40. data/doc/PipedriveRuby/Authorizations.html +231 -0
  41. data/doc/PipedriveRuby/Base.html +456 -0
  42. data/doc/PipedriveRuby/Currencies.html +162 -0
  43. data/doc/PipedriveRuby/DealFields.html +148 -0
  44. data/doc/PipedriveRuby/Deals.html +842 -0
  45. data/doc/PipedriveRuby/HttpFactory.html +1362 -0
  46. data/doc/PipedriveRuby/Organizations.html +148 -0
  47. data/doc/PipedriveRuby/PipedriveClient.html +385 -0
  48. data/doc/PipedriveRuby/Products.html +319 -0
  49. data/doc/PipedriveRuby/PushNotifications.html +159 -0
  50. data/doc/PipedriveRuby/Recents.html +159 -0
  51. data/doc/PipedriveRuby/SearchResults.html +250 -0
  52. data/doc/PipedriveRuby/UserConnections.html +159 -0
  53. data/doc/PipedriveRuby/UserSettings.html +159 -0
  54. data/doc/PipedriveRuby.html +174 -0
  55. data/doc/Pipelines.html +134 -0
  56. data/doc/ProductFields.html +147 -0
  57. data/doc/Products.html +140 -0
  58. data/doc/PushNotifications.html +141 -0
  59. data/doc/Recent.html +134 -0
  60. data/doc/Roles.html +134 -0
  61. data/doc/SearchResults.html +135 -0
  62. data/doc/UserConnections.html +134 -0
  63. data/doc/UserSettings.html +134 -0
  64. data/doc/Users.html +137 -0
  65. data/doc/_index.html +425 -0
  66. data/doc/class_list.html +51 -0
  67. data/doc/css/common.css +1 -0
  68. data/doc/css/full_list.css +58 -0
  69. data/doc/css/style.css +474 -0
  70. data/doc/file.README.html +160 -0
  71. data/doc/file_list.html +56 -0
  72. data/doc/frames.html +17 -0
  73. data/doc/index.html +160 -0
  74. data/doc/js/app.js +243 -0
  75. data/doc/js/full_list.js +216 -0
  76. data/doc/js/jquery.js +4 -0
  77. data/doc/method_list.html +411 -0
  78. data/doc/top-level-namespace.html +114 -0
  79. data/lib/http_factory.rb +154 -0
  80. data/lib/pipedrive_client.rb +24 -0
  81. data/lib/pipedrive_ruby/version.rb +4 -0
  82. data/lib/pipedrive_ruby.rb +48 -0
  83. data/lib/resources/activities.rb +9 -0
  84. data/lib/resources/activitiy_fields.rb +6 -0
  85. data/lib/resources/activity_types.rb +11 -0
  86. data/lib/resources/authorizations.rb +16 -0
  87. data/lib/resources/base.rb +17 -0
  88. data/lib/resources/currencies.rb +13 -0
  89. data/lib/resources/deal_fields.rb +10 -0
  90. data/lib/resources/deals.rb +72 -0
  91. data/lib/resources/email_messages.rb +5 -0
  92. data/lib/resources/email_threads.rb +4 -0
  93. data/lib/resources/files.rb +4 -0
  94. data/lib/resources/filters.rb +4 -0
  95. data/lib/resources/global_messages.rb +3 -0
  96. data/lib/resources/goals.rb +4 -0
  97. data/lib/resources/note_fields.rb +3 -0
  98. data/lib/resources/notes.rb +4 -0
  99. data/lib/resources/organization_fields.rb +8 -0
  100. data/lib/resources/organization_relationships.rb +3 -0
  101. data/lib/resources/organizations.rb +7 -0
  102. data/lib/resources/permission_sets.rb +3 -0
  103. data/lib/resources/person_fields.rb +3 -0
  104. data/lib/resources/persons.rb +4 -0
  105. data/lib/resources/pipelines.rb +3 -0
  106. data/lib/resources/product_fields.rb +8 -0
  107. data/lib/resources/products.rb +29 -0
  108. data/lib/resources/push_notifications.rb +10 -0
  109. data/lib/resources/recents.rb +6 -0
  110. data/lib/resources/roles.rb +3 -0
  111. data/lib/resources/search_results.rb +14 -0
  112. data/lib/resources/stages.rb +4 -0
  113. data/lib/resources/user_connections.rb +7 -0
  114. data/lib/resources/user_settings.rb +6 -0
  115. data/lib/resources/users.rb +5 -0
  116. data/pipedrive_ruby.gemspec +34 -0
  117. metadata +286 -0
@@ -0,0 +1,411 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
5
+ <meta charset="utf-8" />
6
+
7
+ <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
8
+
9
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
10
+
11
+
12
+
13
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
16
+
17
+
18
+ <title>Method List</title>
19
+ <base id="base_target" target="_parent" />
20
+ </head>
21
+ <body>
22
+ <div id="content">
23
+ <div class="fixed_header">
24
+ <h1 id="full_list_header">Method List</h1>
25
+ <div id="full_list_nav">
26
+
27
+ <span><a target="_self" href="class_list.html">
28
+ Classes
29
+ </a></span>
30
+
31
+ <span><a target="_self" href="method_list.html">
32
+ Methods
33
+ </a></span>
34
+
35
+ <span><a target="_self" href="file_list.html">
36
+ Files
37
+ </a></span>
38
+
39
+ </div>
40
+
41
+ <div id="search">Search: <input type="text" /></div>
42
+ </div>
43
+
44
+ <ul id="full_list" class="method">
45
+
46
+
47
+ <li class="odd ">
48
+ <div class="item">
49
+ <span class='object_link'><a href="PipedriveRuby/Deals.html#activities-instance_method" title="PipedriveRuby::Deals#activities (method)">#activities</a></span>
50
+ <small>PipedriveRuby::Deals</small>
51
+ </div>
52
+ </li>
53
+
54
+
55
+ <li class="even ">
56
+ <div class="item">
57
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#add_follower-instance_method" title="PipedriveRuby::HttpFactory#add_follower (method)">#add_follower</a></span>
58
+ <small>PipedriveRuby::HttpFactory</small>
59
+ </div>
60
+ </li>
61
+
62
+
63
+ <li class="odd ">
64
+ <div class="item">
65
+ <span class='object_link'><a href="PipedriveRuby/Deals.html#add_participant-instance_method" title="PipedriveRuby::Deals#add_participant (method)">#add_participant</a></span>
66
+ <small>PipedriveRuby::Deals</small>
67
+ </div>
68
+ </li>
69
+
70
+
71
+ <li class="even ">
72
+ <div class="item">
73
+ <span class='object_link'><a href="PipedriveRuby/Deals.html#add_product-instance_method" title="PipedriveRuby::Deals#add_product (method)">#add_product</a></span>
74
+ <small>PipedriveRuby::Deals</small>
75
+ </div>
76
+ </li>
77
+
78
+
79
+ <li class="odd ">
80
+ <div class="item">
81
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#all-instance_method" title="PipedriveRuby::HttpFactory#all (method)">#all</a></span>
82
+ <small>PipedriveRuby::HttpFactory</small>
83
+ </div>
84
+ </li>
85
+
86
+
87
+ <li class="even ">
88
+ <div class="item">
89
+ <span class='object_link'><a href="PipedriveRuby/Authorizations.html#all-instance_method" title="PipedriveRuby::Authorizations#all (method)">#all</a></span>
90
+ <small>PipedriveRuby::Authorizations</small>
91
+ </div>
92
+ </li>
93
+
94
+
95
+ <li class="odd ">
96
+ <div class="item">
97
+ <span class='object_link'><a href="PipedriveRuby/PipedriveClient.html#api_token-instance_method" title="PipedriveRuby::PipedriveClient#api_token (method)">#api_token</a></span>
98
+ <small>PipedriveRuby::PipedriveClient</small>
99
+ </div>
100
+ </li>
101
+
102
+
103
+ <li class="even ">
104
+ <div class="item">
105
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#base_url-instance_method" title="PipedriveRuby::HttpFactory#base_url (method)">#base_url</a></span>
106
+ <small>PipedriveRuby::HttpFactory</small>
107
+ </div>
108
+ </li>
109
+
110
+
111
+ <li class="odd ">
112
+ <div class="item">
113
+ <span class='object_link'><a href="PipedriveRuby/Base.html#base_url-instance_method" title="PipedriveRuby::Base#base_url (method)">#base_url</a></span>
114
+ <small>PipedriveRuby::Base</small>
115
+ </div>
116
+ </li>
117
+
118
+
119
+ <li class="even ">
120
+ <div class="item">
121
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#class_name-instance_method" title="PipedriveRuby::HttpFactory#class_name (method)">#class_name</a></span>
122
+ <small>PipedriveRuby::HttpFactory</small>
123
+ </div>
124
+ </li>
125
+
126
+
127
+ <li class="odd ">
128
+ <div class="item">
129
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#client-instance_method" title="PipedriveRuby::HttpFactory#client (method)">#client</a></span>
130
+ <small>PipedriveRuby::HttpFactory</small>
131
+ </div>
132
+ </li>
133
+
134
+
135
+ <li class="even ">
136
+ <div class="item">
137
+ <span class='object_link'><a href="PipedriveRuby/Base.html#client-instance_method" title="PipedriveRuby::Base#client (method)">#client</a></span>
138
+ <small>PipedriveRuby::Base</small>
139
+ </div>
140
+ </li>
141
+
142
+
143
+ <li class="odd ">
144
+ <div class="item">
145
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#create-instance_method" title="PipedriveRuby::HttpFactory#create (method)">#create</a></span>
146
+ <small>PipedriveRuby::HttpFactory</small>
147
+ </div>
148
+ </li>
149
+
150
+
151
+ <li class="even ">
152
+ <div class="item">
153
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#custom_get-instance_method" title="PipedriveRuby::HttpFactory#custom_get (method)">#custom_get</a></span>
154
+ <small>PipedriveRuby::HttpFactory</small>
155
+ </div>
156
+ </li>
157
+
158
+
159
+ <li class="odd ">
160
+ <div class="item">
161
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#custom_post-instance_method" title="PipedriveRuby::HttpFactory#custom_post (method)">#custom_post</a></span>
162
+ <small>PipedriveRuby::HttpFactory</small>
163
+ </div>
164
+ </li>
165
+
166
+
167
+ <li class="even ">
168
+ <div class="item">
169
+ <span class='object_link'><a href="PipedriveRuby/Products.html#deals-instance_method" title="PipedriveRuby::Products#deals (method)">#deals</a></span>
170
+ <small>PipedriveRuby::Products</small>
171
+ </div>
172
+ </li>
173
+
174
+
175
+ <li class="odd ">
176
+ <div class="item">
177
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#default_param-instance_method" title="PipedriveRuby::HttpFactory#default_param (method)">#default_param</a></span>
178
+ <small>PipedriveRuby::HttpFactory</small>
179
+ </div>
180
+ </li>
181
+
182
+
183
+ <li class="even ">
184
+ <div class="item">
185
+ <span class='object_link'><a href="PipedriveRuby/Deals.html#delete_follower-instance_method" title="PipedriveRuby::Deals#delete_follower (method)">#delete_follower</a></span>
186
+ <small>PipedriveRuby::Deals</small>
187
+ </div>
188
+ </li>
189
+
190
+
191
+ <li class="odd ">
192
+ <div class="item">
193
+ <span class='object_link'><a href="PipedriveRuby/Products.html#delete_follower-instance_method" title="PipedriveRuby::Products#delete_follower (method)">#delete_follower</a></span>
194
+ <small>PipedriveRuby::Products</small>
195
+ </div>
196
+ </li>
197
+
198
+
199
+ <li class="even ">
200
+ <div class="item">
201
+ <span class='object_link'><a href="PipedriveRuby/Deals.html#delete_participant-instance_method" title="PipedriveRuby::Deals#delete_participant (method)">#delete_participant</a></span>
202
+ <small>PipedriveRuby::Deals</small>
203
+ </div>
204
+ </li>
205
+
206
+
207
+ <li class="odd ">
208
+ <div class="item">
209
+ <span class='object_link'><a href="PipedriveRuby/Deals.html#delete_product-instance_method" title="PipedriveRuby::Deals#delete_product (method)">#delete_product</a></span>
210
+ <small>PipedriveRuby::Deals</small>
211
+ </div>
212
+ </li>
213
+
214
+
215
+ <li class="even ">
216
+ <div class="item">
217
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#duplicate-instance_method" title="PipedriveRuby::HttpFactory#duplicate (method)">#duplicate</a></span>
218
+ <small>PipedriveRuby::HttpFactory</small>
219
+ </div>
220
+ </li>
221
+
222
+
223
+ <li class="odd ">
224
+ <div class="item">
225
+ <span class='object_link'><a href="PipedriveRuby/Deals.html#emails-instance_method" title="PipedriveRuby::Deals#emails (method)">#emails</a></span>
226
+ <small>PipedriveRuby::Deals</small>
227
+ </div>
228
+ </li>
229
+
230
+
231
+ <li class="even ">
232
+ <div class="item">
233
+ <span class='object_link'><a href="PipedriveRuby/Base.html#endpoints-instance_method" title="PipedriveRuby::Base#endpoints (method)">#endpoints</a></span>
234
+ <small>PipedriveRuby::Base</small>
235
+ </div>
236
+ </li>
237
+
238
+
239
+ <li class="odd ">
240
+ <div class="item">
241
+ <span class='object_link'><a href="PipedriveRuby/SearchResults.html#field-instance_method" title="PipedriveRuby::SearchResults#field (method)">#field</a></span>
242
+ <small>PipedriveRuby::SearchResults</small>
243
+ </div>
244
+ </li>
245
+
246
+
247
+ <li class="even ">
248
+ <div class="item">
249
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#files-instance_method" title="PipedriveRuby::HttpFactory#files (method)">#files</a></span>
250
+ <small>PipedriveRuby::HttpFactory</small>
251
+ </div>
252
+ </li>
253
+
254
+
255
+ <li class="odd ">
256
+ <div class="item">
257
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#find-instance_method" title="PipedriveRuby::HttpFactory#find (method)">#find</a></span>
258
+ <small>PipedriveRuby::HttpFactory</small>
259
+ </div>
260
+ </li>
261
+
262
+
263
+ <li class="even ">
264
+ <div class="item">
265
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#find_by-instance_method" title="PipedriveRuby::HttpFactory#find_by (method)">#find_by</a></span>
266
+ <small>PipedriveRuby::HttpFactory</small>
267
+ </div>
268
+ </li>
269
+
270
+
271
+ <li class="odd ">
272
+ <div class="item">
273
+ <span class='object_link'><a href="PipedriveRuby/Products.html#find_by_name-instance_method" title="PipedriveRuby::Products#find_by_name (method)">#find_by_name</a></span>
274
+ <small>PipedriveRuby::Products</small>
275
+ </div>
276
+ </li>
277
+
278
+
279
+ <li class="even ">
280
+ <div class="item">
281
+ <span class='object_link'><a href="PipedriveRuby/Deals.html#find_by_title-instance_method" title="PipedriveRuby::Deals#find_by_title (method)">#find_by_title</a></span>
282
+ <small>PipedriveRuby::Deals</small>
283
+ </div>
284
+ </li>
285
+
286
+
287
+ <li class="odd ">
288
+ <div class="item">
289
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#followers-instance_method" title="PipedriveRuby::HttpFactory#followers (method)">#followers</a></span>
290
+ <small>PipedriveRuby::HttpFactory</small>
291
+ </div>
292
+ </li>
293
+
294
+
295
+ <li class="even ">
296
+ <div class="item">
297
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#initialize-instance_method" title="PipedriveRuby::HttpFactory#initialize (method)">#initialize</a></span>
298
+ <small>PipedriveRuby::HttpFactory</small>
299
+ </div>
300
+ </li>
301
+
302
+
303
+ <li class="odd ">
304
+ <div class="item">
305
+ <span class='object_link'><a href="PipedriveRuby/Base.html#initialize-instance_method" title="PipedriveRuby::Base#initialize (method)">#initialize</a></span>
306
+ <small>PipedriveRuby::Base</small>
307
+ </div>
308
+ </li>
309
+
310
+
311
+ <li class="even ">
312
+ <div class="item">
313
+ <span class='object_link'><a href="PipedriveRuby/PipedriveClient.html#initialize-instance_method" title="PipedriveRuby::PipedriveClient#initialize (method)">#initialize</a></span>
314
+ <small>PipedriveRuby::PipedriveClient</small>
315
+ </div>
316
+ </li>
317
+
318
+
319
+ <li class="odd ">
320
+ <div class="item">
321
+ <span class='object_link'><a href="PipedriveRuby/Deals.html#log-instance_method" title="PipedriveRuby::Deals#log (method)">#log</a></span>
322
+ <small>PipedriveRuby::Deals</small>
323
+ </div>
324
+ </li>
325
+
326
+
327
+ <li class="even ">
328
+ <div class="item">
329
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#merge-instance_method" title="PipedriveRuby::HttpFactory#merge (method)">#merge</a></span>
330
+ <small>PipedriveRuby::HttpFactory</small>
331
+ </div>
332
+ </li>
333
+
334
+
335
+ <li class="odd ">
336
+ <div class="item">
337
+ <span class='object_link'><a href="PipedriveRuby/PipedriveClient.html#method_missing-instance_method" title="PipedriveRuby::PipedriveClient#method_missing (method)">#method_missing</a></span>
338
+ <small>PipedriveRuby::PipedriveClient</small>
339
+ </div>
340
+ </li>
341
+
342
+
343
+ <li class="even ">
344
+ <div class="item">
345
+ <span class='object_link'><a href="PipedriveRuby/Deals.html#participants-instance_method" title="PipedriveRuby::Deals#participants (method)">#participants</a></span>
346
+ <small>PipedriveRuby::Deals</small>
347
+ </div>
348
+ </li>
349
+
350
+
351
+ <li class="odd ">
352
+ <div class="item">
353
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#permitted_users-instance_method" title="PipedriveRuby::HttpFactory#permitted_users (method)">#permitted_users</a></span>
354
+ <small>PipedriveRuby::HttpFactory</small>
355
+ </div>
356
+ </li>
357
+
358
+
359
+ <li class="even ">
360
+ <div class="item">
361
+ <span class='object_link'><a href="PipedriveRuby/Deals.html#products-instance_method" title="PipedriveRuby::Deals#products (method)">#products</a></span>
362
+ <small>PipedriveRuby::Deals</small>
363
+ </div>
364
+ </li>
365
+
366
+
367
+ <li class="odd ">
368
+ <div class="item">
369
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#remove-instance_method" title="PipedriveRuby::HttpFactory#remove (method)">#remove</a></span>
370
+ <small>PipedriveRuby::HttpFactory</small>
371
+ </div>
372
+ </li>
373
+
374
+
375
+ <li class="even ">
376
+ <div class="item">
377
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#remove_many-instance_method" title="PipedriveRuby::HttpFactory#remove_many (method)">#remove_many</a></span>
378
+ <small>PipedriveRuby::HttpFactory</small>
379
+ </div>
380
+ </li>
381
+
382
+
383
+ <li class="odd ">
384
+ <div class="item">
385
+ <span class='object_link'><a href="PipedriveRuby/Deals.html#timeline-instance_method" title="PipedriveRuby::Deals#timeline (method)">#timeline</a></span>
386
+ <small>PipedriveRuby::Deals</small>
387
+ </div>
388
+ </li>
389
+
390
+
391
+ <li class="even ">
392
+ <div class="item">
393
+ <span class='object_link'><a href="PipedriveRuby/HttpFactory.html#update-instance_method" title="PipedriveRuby::HttpFactory#update (method)">#update</a></span>
394
+ <small>PipedriveRuby::HttpFactory</small>
395
+ </div>
396
+ </li>
397
+
398
+
399
+ <li class="odd ">
400
+ <div class="item">
401
+ <span class='object_link'><a href="PipedriveRuby/Deals.html#update_product-instance_method" title="PipedriveRuby::Deals#update_product (method)">#update_product</a></span>
402
+ <small>PipedriveRuby::Deals</small>
403
+ </div>
404
+ </li>
405
+
406
+
407
+
408
+ </ul>
409
+ </div>
410
+ </body>
411
+ </html>
@@ -0,0 +1,114 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Top Level Namespace
8
+
9
+ &mdash; Documentation by YARD 0.9.0
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index</a> &raquo;
40
+
41
+
42
+ <span class="title">Top Level Namespace</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <iframe id="search_frame" src="class_list.html"></iframe>
63
+
64
+ <div id="content"><h1>Top Level Namespace
65
+
66
+
67
+
68
+ </h1>
69
+ <div class="box_info">
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ </div>
82
+
83
+ <h2>Defined Under Namespace</h2>
84
+ <p class="children">
85
+
86
+
87
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="PipedriveRuby.html" title="PipedriveRuby (module)">PipedriveRuby</a></span>
88
+
89
+
90
+
91
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="EmailMessages.html" title="EmailMessages (class)">EmailMessages</a></span>, <span class='object_link'><a href="EmailThreads.html" title="EmailThreads (class)">EmailThreads</a></span>, <span class='object_link'><a href="Estages.html" title="Estages (class)">Estages</a></span>, <span class='object_link'><a href="Files.html" title="Files (class)">Files</a></span>, <span class='object_link'><a href="Filters.html" title="Filters (class)">Filters</a></span>, <span class='object_link'><a href="GlobalMessages.html" title="GlobalMessages (class)">GlobalMessages</a></span>, <span class='object_link'><a href="Goals.html" title="Goals (class)">Goals</a></span>, <span class='object_link'><a href="NoteFields.html" title="NoteFields (class)">NoteFields</a></span>, <span class='object_link'><a href="Notes.html" title="Notes (class)">Notes</a></span>, <span class='object_link'><a href="OrganizationFields.html" title="OrganizationFields (class)">OrganizationFields</a></span>, <span class='object_link'><a href="OrganizationRelationships.html" title="OrganizationRelationships (class)">OrganizationRelationships</a></span>, <span class='object_link'><a href="PermissionSets.html" title="PermissionSets (class)">PermissionSets</a></span>, <span class='object_link'><a href="PersonFields.html" title="PersonFields (class)">PersonFields</a></span>, <span class='object_link'><a href="Persons.html" title="Persons (class)">Persons</a></span>, <span class='object_link'><a href="Pipelines.html" title="Pipelines (class)">Pipelines</a></span>, <span class='object_link'><a href="ProductFields.html" title="ProductFields (class)">ProductFields</a></span>, <span class='object_link'><a href="Roles.html" title="Roles (class)">Roles</a></span>, <span class='object_link'><a href="Users.html" title="Users (class)">Users</a></span>
92
+
93
+
94
+ </p>
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+ </div>
105
+
106
+ <div id="footer">
107
+ Generated on Tue Jul 19 12:47:24 2016 by
108
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
109
+ 0.9.0 (ruby-2.2.5).
110
+ </div>
111
+
112
+ </div>
113
+ </body>
114
+ </html>
@@ -0,0 +1,154 @@
1
+ module PipedriveRuby
2
+ # responsable for hold all commum endpoints shared between n resources
3
+ class HttpFactory
4
+ extend Forwardable
5
+ include HTTP::Chainable
6
+
7
+ attr_reader :client, :base_url, :class_name, :default_param
8
+
9
+ def initialize(resource_name, client)
10
+ @client = client
11
+ @class_name = resource_name
12
+ @default_param = { api_token: @client.api_token }
13
+ @base_url = make_base_url
14
+ end
15
+
16
+ def add_follower(resource, user)
17
+ custom_post(:path => "#{resource['id']}/followers",
18
+ :json => {:id => resource['id'], :user_id => user['id'] })
19
+ end
20
+
21
+ def all(params={})
22
+ params.merge!(default_param)
23
+ custom_get(:params => params)
24
+ end
25
+
26
+ def create(resource)
27
+ custom_post(:params => default_param, :json => resource)
28
+ end
29
+
30
+ def custom_get(options={})
31
+ options.merge!({:method => :get})
32
+ custom_request(options)
33
+ end
34
+
35
+ def custom_post(options={})
36
+ options.merge!({:method => :post})
37
+ custom_request(options)
38
+ end
39
+
40
+ def custom_put(options={})
41
+ options.merge!({:method => :put})
42
+ custom_request(options)
43
+ end
44
+
45
+ def custom_delete(options={})
46
+ options.merge!({:method => :delete})
47
+ custom_request(options)
48
+ end
49
+
50
+ def delete_follower(resource, follower)
51
+ custom_delete(:path => "#{resource['id']}/followers/#{follower['id']}",
52
+ :json => {:id => resource['id'], :user_id => follower['id'] })
53
+ end
54
+
55
+ def duplicate(resource)
56
+ custom_post(:path => "#{resource['id']}/duplicate", :params => default_param)
57
+ end
58
+
59
+ def find(id)
60
+ custom_get(:path => "#{id}/")
61
+ end
62
+
63
+ def find_by(term)
64
+ custom_get(:path => "find/", :params => {:term => term})
65
+ end
66
+
67
+ def files(resource)
68
+ custom_get(:path => "#{resource['id']}/files")
69
+ end
70
+
71
+ def followers(resource)
72
+ custom_get(:path => "#{resource['id']}/followers")
73
+ end
74
+
75
+ def merge(resource, merge_with_resource)
76
+ id = resource['id']
77
+ post("#{base_url}/#{id}/merge",
78
+ params: default_param,
79
+ form: {
80
+ id: id,
81
+ merge_with_id: merge_with_resource['id']
82
+ }).parse
83
+ end
84
+
85
+ def permitted_users(resource)
86
+ custom_get(:path => "#{resource['id']}/permittedUsers")
87
+ end
88
+
89
+ def remove(resource)
90
+ custom_delete(:path => "#{resource['id']}", :params => default_param)
91
+ end
92
+
93
+ def remove_many(resources)
94
+ ids = []
95
+ resources.each do |resource|
96
+ ids << resource['data']['id']
97
+ end
98
+ custom_delete(:params => default_param, :json => { ids: ids.join(',') })
99
+ end
100
+
101
+ def update(resource)
102
+ custom_put(:path => "#{resource['id']}", :params => default_param, :json => resource)
103
+ end
104
+
105
+ private
106
+
107
+ def call_http(path, options={})
108
+ http_method = options[:method]
109
+ params = options[:params]
110
+ case http_method
111
+ when :get
112
+ parse_response(HTTP.send(http_method, path, params: params))
113
+ else
114
+ parse_response(HTTP.send(http_method, path, params: params, json: options[:json]))
115
+ end
116
+ end
117
+
118
+ def custom_request(options={})
119
+ http_method = options[:method]
120
+ return unless [:get, :post, :put, :delete].include? http_method
121
+ options = set_defaults_params(options)
122
+ path = "#{base_url}/"
123
+ path = path.concat(options[:path]) if options[:path]
124
+ call_http(path,options)
125
+ end
126
+
127
+ def make_base_url
128
+ length = class_name.size
129
+ resource_name = class_name.split('::').last
130
+ resource = resource_name[0].downcase + resource_name[1, length]
131
+ "#{PipedriveRuby::API_URL}/#{resource}"
132
+ end
133
+
134
+ def parse_response(response)
135
+ begin
136
+ response.parse
137
+ rescue
138
+ OpenStruct.new(:status => false,:error_info => nil, :data => nil, :additional_data => nil)
139
+ end
140
+ end
141
+
142
+ def set_defaults_params(options)
143
+ default_options = {:params => default_param}
144
+ params = options[:params]
145
+ if params
146
+ params.merge!(default_options[:params])
147
+ else
148
+ options.merge!(default_options)
149
+ end
150
+ options
151
+ end
152
+
153
+ end
154
+ end