shep 0.1.0.pre.alpha0 → 0.2.1.pre.alpha0
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.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/Rakefile +1 -0
- data/doc/Shep/Entity/Account.html +22 -37
- data/doc/Shep/Entity/Context.html +8 -9
- data/doc/Shep/Entity/CustomEmoji.html +11 -15
- data/doc/Shep/Entity/MediaAttachment.html +13 -19
- data/doc/Shep/Entity/Notification.html +11 -15
- data/doc/Shep/Entity/Status.html +34 -61
- data/doc/Shep/Entity/StatusSource.html +9 -11
- data/doc/Shep/Entity/Status_Application.html +11 -10
- data/doc/Shep/Entity/Status_Mention.html +10 -13
- data/doc/Shep/Entity/Status_Tag.html +8 -9
- data/doc/Shep/Entity.html +156 -141
- data/doc/Shep/Error/Caller.html +4 -4
- data/doc/Shep/Error/Http.html +22 -22
- data/doc/Shep/Error/RateLimit.html +176 -0
- data/doc/Shep/Error/Remote.html +3 -4
- data/doc/Shep/Error/Server.html +5 -4
- data/doc/Shep/Error/Type.html +10 -12
- data/doc/Shep/Error.html +8 -5
- data/doc/Shep/Session.html +1023 -572
- data/doc/Shep.html +20 -5
- data/doc/_index.html +10 -3
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +52 -33
- data/doc/file_list.html +1 -1
- data/doc/index.html +117 -239
- data/doc/method_list.html +9 -1
- data/doc/top-level-namespace.html +2 -2
- data/lib/shep/entity_base.rb +6 -1
- data/lib/shep/exceptions.rb +8 -0
- data/lib/shep/session.rb +340 -145
- data/lib/shep/version.rb +4 -0
- data/lib/shep.rb +1 -1
- data/run_rake_test.example.sh +12 -5
- data/shep.gemspec +4 -2
- data/spec/session_reader_1_unauth_spec.rb +20 -17
- data/spec/session_reader_2_auth_spec.rb +17 -19
- data/spec/session_writer_spec.rb +4 -11
- data/spec/session_zzz_tricky_spec.rb +205 -0
- data/spec/spec_helper.rb +12 -3
- data/yard_helper.rb +11 -5
- metadata +12 -9
data/doc/Shep/Session.html
CHANGED
@@ -101,26 +101,81 @@
|
|
101
101
|
|
102
102
|
<h2>Overview</h2><div class="docstring">
|
103
103
|
<div class="discussion">
|
104
|
-
|
105
|
-
|
104
|
+
<p>Represents a connection to a Mastodon (or equivalent) server.</p>
|
105
|
+
|
106
|
+
<h2 id="conventions">Conventions</h2>
|
106
107
|
|
107
|
-
<
|
108
|
+
<p><code>fetch_*</code> methods retrieve a single Mastodon object, an <code>Entity</code>
|
109
|
+
subinstance.</p>
|
108
110
|
|
109
|
-
<p><code>
|
111
|
+
<p><code>each_*</code> methods retrieve multiple objects, also <code>Entity</code>
|
112
|
+
subinstances. If called with a block, the block is evaluated on
|
113
|
+
each item in turn and the block's result is ignored. Otherwise,
|
114
|
+
it returns an <code>Enumerator</code> which can be used in the usual ways.</p>
|
110
115
|
|
111
|
-
<p
|
116
|
+
<p>Some examples:</p>
|
112
117
|
|
113
|
-
<
|
118
|
+
<pre class="code ruby"><code class="ruby"> <span class='comment'># Evaluate a block on each status
|
119
|
+
</span> <span class='id identifier rubyid_session'>session</span><span class='period'>.</span><span class='id identifier rubyid_each_status'>each_status</span><span class='lparen'>(</span><span class='id identifier rubyid_account'>account</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_status'>status</span><span class='op'>|</span> <span class='id identifier rubyid_do_thing'>do_thing</span><span class='lparen'>(</span><span class='id identifier rubyid_status'>status</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
114
120
|
|
115
|
-
|
121
|
+
<span class='comment'># Retrieve the last 100 statuses in an array
|
122
|
+
</span> <span class='id identifier rubyid_statuses'>statuses</span> <span class='op'>=</span> <span class='id identifier rubyid_session'>session</span><span class='period'>.</span><span class='id identifier rubyid_each_status'>each_status</span><span class='lparen'>(</span><span class='id identifier rubyid_account'>account</span><span class='comma'>,</span> <span class='label'>limit:</span> <span class='int'>100</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span>
|
123
|
+
|
124
|
+
<span class='comment'># Retrieve the last 200 statuses via an enumerator and do
|
125
|
+
</span> <span class='comment'># extra transformation on the result before collecting
|
126
|
+
</span> <span class='comment'># them in an array.
|
127
|
+
</span> <span class='id identifier rubyid_statuses'>statuses</span> <span class='op'>=</span> <span class='id identifier rubyid_session'>session</span><span class='period'>.</span><span class='id identifier rubyid_each_status'>each_status</span><span class='lparen'>(</span><span class='id identifier rubyid_account'>account</span><span class='comma'>,</span> <span class='label'>limit:</span> <span class='int'>200</span><span class='rparen'>)</span>
|
128
|
+
<span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_status'>status</span><span class='op'>|</span> <span class='const'>BESTIES</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_status'>status</span><span class='period'>.</span><span class='id identifier rubyid_account'>account</span><span class='period'>.</span><span class='id identifier rubyid_username'>username</span> <span class='rbrace'>}</span>
|
129
|
+
<span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_status'>status</span><span class='op'>|</span> <span class='id identifier rubyid_status'>status</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span>
|
130
|
+
<span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span>
|
116
131
|
</code></pre>
|
117
132
|
|
118
|
-
<p>
|
133
|
+
<p>The actual web API "paginates" the output. That is, it returns
|
134
|
+
the first 40 (or so) items and then provides a link to the next
|
135
|
+
chunk. Shep's <code>each_*</code> methods handle this for you automatically.
|
136
|
+
This means that unless you use <code>limit:</code>, the <code>each_*</code> methods will
|
137
|
+
retrieve <strong>all</strong> available items, at least until you reach the
|
138
|
+
rate limit (see below).</p>
|
139
|
+
|
140
|
+
<p>Note that it is safe to leave an <code>each_*</code> methods block with
|
141
|
+
<code>break</code>, <code>return</code>, an exception, or any other such mechanism.</p>
|
119
142
|
|
120
|
-
<p>The remaining Mastodon API methods will in some way modify the
|
143
|
+
<p>The remaining Mastodon API methods will in some way modify the
|
144
|
+
state of the server and return an Entity subinstance on success.</p>
|
121
145
|
|
122
146
|
<p>All API calls throw an exception on failure.</p>
|
123
147
|
|
148
|
+
<h2 id="rate-limits">Rate Limits</h2>
|
149
|
+
|
150
|
+
<p>Mastodon servers restrict the number of times you can use a
|
151
|
+
specific endpoint within a time period as a way to prevent abuse.
|
152
|
+
Shep provides several tools for handling these limits gracefully.</p>
|
153
|
+
|
154
|
+
<ol>
|
155
|
+
<li><p>The method <span class='object_link'><a href="#rate_limit-instance_method" title="Shep::Session#rate_limit (method)">#rate_limit</a></span> will return a Struct that tells you how
|
156
|
+
many requests you have left and when the count is reset.</p></li>
|
157
|
+
<li><p>If a rate limit is exceeded, the method will throw an
|
158
|
+
<span class='object_link'><a href="Error/RateLimit.html" title="Shep::Error::RateLimit (class)">Error::RateLimit</a></span> exception instead of an ordinary
|
159
|
+
<span class='object_link'><a href="Error/Http.html" title="Shep::Error::Http (class)">Error::Http</a></span> exception.</p></li>
|
160
|
+
<li><p>If the Session is created with argument <code>rate_limit_retry:</code> set
|
161
|
+
to true, the Session will instead wait out the reset time and
|
162
|
+
try again.</p></li>
|
163
|
+
</ol>
|
164
|
+
|
165
|
+
<p>If you enable the wait-and-retry mechanism, you can also provide a
|
166
|
+
hook function (i.e. a thing that responds to <code>call</code>) via
|
167
|
+
constructor argument <code>retry_hook:</code>. This is called with one
|
168
|
+
argument, the result of <span class='object_link'><a href="#rate_limit-instance_method" title="Shep::Session#rate_limit (method)">#rate_limit</a></span> for the limited API endpoint,
|
169
|
+
immediately before Shep starts waiting for the limit to reset.</p>
|
170
|
+
|
171
|
+
<p>The built-in wait time takes the callback's execution time into
|
172
|
+
account so it's possible to use the callback to do your own
|
173
|
+
waiting and use that time more productively.</p>
|
174
|
+
|
175
|
+
<p>Alternately, all of the <code>each_*</code> methods have a <code>limit:</code> parameter
|
176
|
+
so it's easy to avoid making too many API calls and many have a
|
177
|
+
<code>max_id:</code> parameter that allows you to continue where you left off.</p>
|
178
|
+
|
124
179
|
|
125
180
|
</div>
|
126
181
|
</div>
|
@@ -156,8 +211,7 @@
|
|
156
211
|
|
157
212
|
|
158
213
|
|
159
|
-
<span class="summary_desc"><div class='inline'>
|
160
|
-
<p>The Server’s hostname.</p>
|
214
|
+
<span class="summary_desc"><div class='inline'><p>The Server's hostname.</p>
|
161
215
|
</div></span>
|
162
216
|
|
163
217
|
</li>
|
@@ -185,8 +239,35 @@
|
|
185
239
|
|
186
240
|
|
187
241
|
|
188
|
-
<span class="summary_desc"><div class='inline'>
|
189
|
-
|
242
|
+
<span class="summary_desc"><div class='inline'><p>The logger object.</p>
|
243
|
+
</div></span>
|
244
|
+
|
245
|
+
</li>
|
246
|
+
|
247
|
+
|
248
|
+
<li class="public ">
|
249
|
+
<span class="summary_signature">
|
250
|
+
|
251
|
+
<a href="#user_agent-instance_method" title="#user_agent (instance method)">#<strong>user_agent</strong> ⇒ String </a>
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
</span>
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
<span class="note title readonly">readonly</span>
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
<span class="summary_desc"><div class='inline'><p>User-Agent string; frozen.</p>
|
190
271
|
</div></span>
|
191
272
|
|
192
273
|
</li>
|
@@ -222,8 +303,7 @@
|
|
222
303
|
|
223
304
|
|
224
305
|
|
225
|
-
<span class="summary_desc"><div class='inline'>
|
226
|
-
<p>Delete the status at ID.</p>
|
306
|
+
<span class="summary_desc"><div class='inline'><p>Delete the status at ID.</p>
|
227
307
|
</div></span>
|
228
308
|
|
229
309
|
</li>
|
@@ -246,8 +326,7 @@
|
|
246
326
|
|
247
327
|
|
248
328
|
|
249
|
-
<span class="summary_desc"><div class='inline'>
|
250
|
-
<p>Dismiss the notification with the given ID.</p>
|
329
|
+
<span class="summary_desc"><div class='inline'><p>Dismiss the notification with the given ID.</p>
|
251
330
|
</div></span>
|
252
331
|
|
253
332
|
</li>
|
@@ -270,8 +349,7 @@
|
|
270
349
|
|
271
350
|
|
272
351
|
|
273
|
-
<span class="summary_desc"><div class='inline'>
|
274
|
-
<p>Retrieve each Entity::Account that boosted the given status.</p>
|
352
|
+
<span class="summary_desc"><div class='inline'><p>Retrieve each Entity::Account that boosted the given status.</p>
|
275
353
|
</div></span>
|
276
354
|
|
277
355
|
</li>
|
@@ -294,8 +372,7 @@
|
|
294
372
|
|
295
373
|
|
296
374
|
|
297
|
-
<span class="summary_desc"><div class='inline'>
|
298
|
-
<p>Retrieve each account that favourited the given status.</p>
|
375
|
+
<span class="summary_desc"><div class='inline'><p>Retrieve each account that favourited the given status.</p>
|
299
376
|
</div></span>
|
300
377
|
|
301
378
|
</li>
|
@@ -318,8 +395,7 @@
|
|
318
395
|
|
319
396
|
|
320
397
|
|
321
|
-
<span class="summary_desc"><div class='inline'>
|
322
|
-
<p>Retrieve the follower list of an account.</p>
|
398
|
+
<span class="summary_desc"><div class='inline'><p>Retrieve the follower list of an account.</p>
|
323
399
|
</div></span>
|
324
400
|
|
325
401
|
</li>
|
@@ -342,8 +418,7 @@
|
|
342
418
|
|
343
419
|
|
344
420
|
|
345
|
-
<span class="summary_desc"><div class='inline'>
|
346
|
-
<p>Retrieve the list of accounts this account follows.</p>
|
421
|
+
<span class="summary_desc"><div class='inline'><p>Retrieve the list of accounts this account follows.</p>
|
347
422
|
</div></span>
|
348
423
|
|
349
424
|
</li>
|
@@ -352,7 +427,7 @@
|
|
352
427
|
<li class="public ">
|
353
428
|
<span class="summary_signature">
|
354
429
|
|
355
|
-
<a href="#each_home_status-instance_method" title="#each_home_status (instance method)">#<strong>each_home_status</strong>(limit: nil, local: false, remote: false, only_media: false) {|item| ... } ⇒ Enumerator </a>
|
430
|
+
<a href="#each_home_status-instance_method" title="#each_home_status (instance method)">#<strong>each_home_status</strong>(limit: nil, local: false, max_id: "", remote: false, only_media: false) {|item| ... } ⇒ Enumerator </a>
|
356
431
|
|
357
432
|
|
358
433
|
|
@@ -366,8 +441,7 @@
|
|
366
441
|
|
367
442
|
|
368
443
|
|
369
|
-
<span class="summary_desc"><div class='inline'>
|
370
|
-
<p>Retrieve each Entity::Status in the home timeline.</p>
|
444
|
+
<span class="summary_desc"><div class='inline'><p>Retrieve each Entity::Status in the home timeline.</p>
|
371
445
|
</div></span>
|
372
446
|
|
373
447
|
</li>
|
@@ -390,8 +464,7 @@
|
|
390
464
|
|
391
465
|
|
392
466
|
|
393
|
-
<span class="summary_desc"><div class='inline'>
|
394
|
-
<p>Retrieve each notification.</p>
|
467
|
+
<span class="summary_desc"><div class='inline'><p>Retrieve each notification.</p>
|
395
468
|
</div></span>
|
396
469
|
|
397
470
|
</li>
|
@@ -400,7 +473,7 @@
|
|
400
473
|
<li class="public ">
|
401
474
|
<span class="summary_signature">
|
402
475
|
|
403
|
-
<a href="#each_public_status-instance_method" title="#each_public_status (instance method)">#<strong>each_public_status</strong>(limit: nil, local: false, remote: false, only_media: false) {|item| ... } ⇒ Enumerator </a>
|
476
|
+
<a href="#each_public_status-instance_method" title="#each_public_status (instance method)">#<strong>each_public_status</strong>(limit: nil, max_id: "", local: false, remote: false, only_media: false) {|item| ... } ⇒ Enumerator </a>
|
404
477
|
|
405
478
|
|
406
479
|
|
@@ -414,8 +487,7 @@
|
|
414
487
|
|
415
488
|
|
416
489
|
|
417
|
-
<span class="summary_desc"><div class='inline'>
|
418
|
-
<p>Retrieve the instance’s public timeline(s).</p>
|
490
|
+
<span class="summary_desc"><div class='inline'><p>Retrieve the instance's public timeline(s).</p>
|
419
491
|
</div></span>
|
420
492
|
|
421
493
|
</li>
|
@@ -424,7 +496,7 @@
|
|
424
496
|
<li class="public ">
|
425
497
|
<span class="summary_signature">
|
426
498
|
|
427
|
-
<a href="#each_status-instance_method" title="#each_status (instance method)">#<strong>each_status</strong>(account_id, limit: nil, only_media: false, exclude_replies: false, exclude_reblogs: false, pinned: false, tagged: nil) {|item| ... } ⇒ Enumerator </a>
|
499
|
+
<a href="#each_status-instance_method" title="#each_status (instance method)">#<strong>each_status</strong>(account_id, limit: nil, max_id: "", only_media: false, exclude_replies: false, exclude_reblogs: false, pinned: false, tagged: nil) {|item| ... } ⇒ Enumerator </a>
|
428
500
|
|
429
501
|
|
430
502
|
|
@@ -438,8 +510,7 @@
|
|
438
510
|
|
439
511
|
|
440
512
|
|
441
|
-
<span class="summary_desc"><div class='inline'>
|
442
|
-
<p>Retrieve the account’s statuses.</p>
|
513
|
+
<span class="summary_desc"><div class='inline'><p>Retrieve the account's statuses.</p>
|
443
514
|
</div></span>
|
444
515
|
|
445
516
|
</li>
|
@@ -448,7 +519,7 @@
|
|
448
519
|
<li class="public ">
|
449
520
|
<span class="summary_signature">
|
450
521
|
|
451
|
-
<a href="#each_tag_status-instance_method" title="#each_tag_status (instance method)">#<strong>each_tag_status</strong>(hashtag_s, limit: nil, local: false, remote: false, only_media: false, all: [], none: []) {|item| ... } ⇒ Enumerator </a>
|
522
|
+
<a href="#each_tag_status-instance_method" title="#each_tag_status (instance method)">#<strong>each_tag_status</strong>(hashtag_s, limit: nil, max_id: "", local: false, remote: false, only_media: false, all: [], none: []) {|item| ... } ⇒ Enumerator </a>
|
452
523
|
|
453
524
|
|
454
525
|
|
@@ -462,8 +533,7 @@
|
|
462
533
|
|
463
534
|
|
464
535
|
|
465
|
-
<span class="summary_desc"><div class='inline'>
|
466
|
-
<p>Retrieve a tag’s timeline.</p>
|
536
|
+
<span class="summary_desc"><div class='inline'><p>Retrieve a tag's timeline.</p>
|
467
537
|
</div></span>
|
468
538
|
|
469
539
|
</li>
|
@@ -486,8 +556,7 @@
|
|
486
556
|
|
487
557
|
|
488
558
|
|
489
|
-
<span class="summary_desc"><div class='inline'>
|
490
|
-
<p>Update the status with the given Id.</p>
|
559
|
+
<span class="summary_desc"><div class='inline'><p>Update the status with the given Id.</p>
|
491
560
|
</div></span>
|
492
561
|
|
493
562
|
</li>
|
@@ -510,8 +579,7 @@
|
|
510
579
|
|
511
580
|
|
512
581
|
|
513
|
-
<span class="summary_desc"><div class='inline'>
|
514
|
-
<p>Fetch user details by ID.</p>
|
582
|
+
<span class="summary_desc"><div class='inline'><p>Fetch user details by ID.</p>
|
515
583
|
</div></span>
|
516
584
|
|
517
585
|
</li>
|
@@ -520,7 +588,7 @@
|
|
520
588
|
<li class="public ">
|
521
589
|
<span class="summary_signature">
|
522
590
|
|
523
|
-
<a href="#fetch_account_by_username-instance_method" title="#fetch_account_by_username (instance method)">#<strong>fetch_account_by_username</strong>(handle) ⇒ Entity::Account </a>
|
591
|
+
<a href="#fetch_account_by_username-instance_method" title="#fetch_account_by_username (instance method)">#<strong>fetch_account_by_username</strong>(handle) ⇒ Entity::Account<sup>?</sup> </a>
|
524
592
|
|
525
593
|
|
526
594
|
|
@@ -534,8 +602,7 @@
|
|
534
602
|
|
535
603
|
|
536
604
|
|
537
|
-
<span class="summary_desc"><div class='inline'>
|
538
|
-
<p>Fetch user details by username.</p>
|
605
|
+
<span class="summary_desc"><div class='inline'><p>Fetch user details by username.</p>
|
539
606
|
</div></span>
|
540
607
|
|
541
608
|
</li>
|
@@ -558,8 +625,7 @@
|
|
558
625
|
|
559
626
|
|
560
627
|
|
561
|
-
<span class="summary_desc"><div class='inline'>
|
562
|
-
<p>Fetch the context (parent and child status) of status at ‘id’.</p>
|
628
|
+
<span class="summary_desc"><div class='inline'><p>Fetch the context (parent and child status) of status at 'id'.</p>
|
563
629
|
</div></span>
|
564
630
|
|
565
631
|
</li>
|
@@ -582,8 +648,7 @@
|
|
582
648
|
|
583
649
|
|
584
650
|
|
585
|
-
<span class="summary_desc"><div class='inline'>
|
586
|
-
<p>Fetch an individual notification by ID.</p>
|
651
|
+
<span class="summary_desc"><div class='inline'><p>Fetch an individual notification by ID.</p>
|
587
652
|
</div></span>
|
588
653
|
|
589
654
|
</li>
|
@@ -606,8 +671,7 @@
|
|
606
671
|
|
607
672
|
|
608
673
|
|
609
|
-
<span class="summary_desc"><div class='inline'>
|
610
|
-
<p>Fetch a single status.</p>
|
674
|
+
<span class="summary_desc"><div class='inline'><p>Fetch a single status.</p>
|
611
675
|
</div></span>
|
612
676
|
|
613
677
|
</li>
|
@@ -630,8 +694,7 @@
|
|
630
694
|
|
631
695
|
|
632
696
|
|
633
|
-
<span class="summary_desc"><div class='inline'>
|
634
|
-
<p>Fetch the editable source of status at id.</p>
|
697
|
+
<span class="summary_desc"><div class='inline'><p>Fetch the editable source of status at id.</p>
|
635
698
|
</div></span>
|
636
699
|
|
637
700
|
</li>
|
@@ -654,8 +717,7 @@
|
|
654
717
|
|
655
718
|
|
656
719
|
|
657
|
-
<span class="summary_desc"><div class='inline'>
|
658
|
-
<p>Fetch the given status and also any attached media.</p>
|
720
|
+
<span class="summary_desc"><div class='inline'><p>Fetch the given status and also any attached media.</p>
|
659
721
|
</div></span>
|
660
722
|
|
661
723
|
</li>
|
@@ -664,7 +726,7 @@
|
|
664
726
|
<li class="public ">
|
665
727
|
<span class="summary_signature">
|
666
728
|
|
667
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(host:, token: nil, logger: nil, debug_http: false) ⇒ Session </a>
|
729
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(host:, token: nil, user_agent: "ShepRubyGem/#{Shep::Version}", ua_comment: nil, rate_limit_retry: false, retry_hook: nil, logger: nil, debug_http: false) ⇒ Session </a>
|
668
730
|
|
669
731
|
|
670
732
|
|
@@ -680,8 +742,7 @@
|
|
680
742
|
|
681
743
|
|
682
744
|
|
683
|
-
<span class="summary_desc"><div class='inline'>
|
684
|
-
<p>Initialize a new <span class='object_link'><a href="" title="Shep::Session (class)">Session</a></span>.</p>
|
745
|
+
<span class="summary_desc"><div class='inline'><p>Initialize a new <span class='object_link'><a href="" title="Shep::Session (class)">Session</a></span>.</p>
|
685
746
|
</div></span>
|
686
747
|
|
687
748
|
</li>
|
@@ -690,7 +751,7 @@
|
|
690
751
|
<li class="public ">
|
691
752
|
<span class="summary_signature">
|
692
753
|
|
693
|
-
<a href="#post_status-instance_method" title="#post_status (instance method)">#<strong>post_status</strong>(text, visibility: :private, media_ids: [], spoiler_text: "", language: "") ⇒
|
754
|
+
<a href="#post_status-instance_method" title="#post_status (instance method)">#<strong>post_status</strong>(text, visibility: :private, media_ids: [], spoiler_text: "", language: "") ⇒ Entity::Status </a>
|
694
755
|
|
695
756
|
|
696
757
|
|
@@ -704,8 +765,7 @@
|
|
704
765
|
|
705
766
|
|
706
767
|
|
707
|
-
<span class="summary_desc"><div class='inline'>
|
708
|
-
<p>Post a status containing the given text at the specified visibility with zero or more media attachments.</p>
|
768
|
+
<span class="summary_desc"><div class='inline'><p>Post a status containing the given text at the specified visibility with zero or more media attachments.</p>
|
709
769
|
</div></span>
|
710
770
|
|
711
771
|
</li>
|
@@ -728,8 +788,7 @@
|
|
728
788
|
|
729
789
|
|
730
790
|
|
731
|
-
<span class="summary_desc"><div class='inline'>
|
732
|
-
<p>Return the rate limit information as of the last operation.</p>
|
791
|
+
<span class="summary_desc"><div class='inline'><p>Return the rate limit information from the last REST request.</p>
|
733
792
|
</div></span>
|
734
793
|
|
735
794
|
</li>
|
@@ -752,8 +811,7 @@
|
|
752
811
|
|
753
812
|
|
754
813
|
|
755
|
-
<span class="summary_desc"><div class='inline'>
|
756
|
-
<p>Return a human-readable summary of the rate limit.</p>
|
814
|
+
<span class="summary_desc"><div class='inline'><p>Return a human-readable summary of the rate limit.</p>
|
757
815
|
</div></span>
|
758
816
|
|
759
817
|
</li>
|
@@ -762,7 +820,7 @@
|
|
762
820
|
<li class="public ">
|
763
821
|
<span class="summary_signature">
|
764
822
|
|
765
|
-
<a href="#upload_media-instance_method" title="#upload_media (instance method)">#<strong>upload_media</strong>(path, content_type: nil, description: nil, focus_x: nil, focus_y: nil) ⇒
|
823
|
+
<a href="#upload_media-instance_method" title="#upload_media (instance method)">#<strong>upload_media</strong>(path, content_type: nil, description: nil, focus_x: nil, focus_y: nil) ⇒ Entity::MediaAttachment </a>
|
766
824
|
|
767
825
|
|
768
826
|
|
@@ -776,8 +834,7 @@
|
|
776
834
|
|
777
835
|
|
778
836
|
|
779
|
-
<span class="summary_desc"><div class='inline'>
|
780
|
-
<p>Upload the media contained in the file at ‘path’.</p>
|
837
|
+
<span class="summary_desc"><div class='inline'><p>Upload the media contained in the file at 'path'.</p>
|
781
838
|
</div></span>
|
782
839
|
|
783
840
|
</li>
|
@@ -800,8 +857,7 @@
|
|
800
857
|
|
801
858
|
|
802
859
|
|
803
|
-
<span class="summary_desc"><div class='inline'>
|
804
|
-
<p>Return the Entity::Account object for the token we’re using.</p>
|
860
|
+
<span class="summary_desc"><div class='inline'><p>Return the Entity::Account object for the token we're using.</p>
|
805
861
|
</div></span>
|
806
862
|
|
807
863
|
</li>
|
@@ -816,7 +872,7 @@
|
|
816
872
|
<div class="method_details first">
|
817
873
|
<h3 class="signature first" id="initialize-instance_method">
|
818
874
|
|
819
|
-
#<strong>initialize</strong>(host:, token: nil, logger: nil, debug_http: false) ⇒ <tt><span class='object_link'><a href="" title="Shep::Session (class)">Session</a></span></tt>
|
875
|
+
#<strong>initialize</strong>(host:, token: nil, user_agent: "ShepRubyGem/#{Shep::Version}", ua_comment: nil, rate_limit_retry: false, retry_hook: nil, logger: nil, debug_http: false) ⇒ <tt><span class='object_link'><a href="" title="Shep::Session (class)">Session</a></span></tt>
|
820
876
|
|
821
877
|
|
822
878
|
|
@@ -824,12 +880,27 @@
|
|
824
880
|
|
825
881
|
</h3><div class="docstring">
|
826
882
|
<div class="discussion">
|
827
|
-
|
828
|
-
|
883
|
+
<p>Initialize a new <span class='object_link'><a href="" title="Shep::Session (class)">Shep::Session</a></span>.</p>
|
884
|
+
|
885
|
+
<p>By default, the User-Agent header is set to the gem's
|
886
|
+
identifier, but may be overridden with the <code>user_agent</code>
|
887
|
+
parameter. It is your responsibility to make sure it is
|
888
|
+
formatted correctly. You can also append comment text to the
|
889
|
+
given User-Agent string with <code>ua_comment</code>; this lets you add a
|
890
|
+
comment to the default text.</p>
|
891
|
+
|
892
|
+
<p>Parameter <code>logger</code> may be a <code>Logger</code> object, <code>nil</code>, or a
|
893
|
+
<code>Symbol</code> whose value is the name of one of the supported log
|
894
|
+
levels. In the latter case, a new Logger is created and set to
|
895
|
+
that level. If <code>nil</code> is given, a dummy <code>Logger</code> is created and
|
896
|
+
used.</p>
|
829
897
|
|
830
|
-
<p>
|
898
|
+
<p>If <code>debug_http</code> is true, compression is disabled and the
|
899
|
+
transactions are sent to <code>STDERR</code> via
|
900
|
+
<code>Net::HTTP.set_debug_output</code>.</p>
|
831
901
|
|
832
|
-
<p
|
902
|
+
<p><strong>WARNING:</strong> this opens a serious security hole and should not
|
903
|
+
be used in production.</p>
|
833
904
|
|
834
905
|
|
835
906
|
</div>
|
@@ -848,8 +919,7 @@
|
|
848
919
|
|
849
920
|
|
850
921
|
—
|
851
|
-
<div class='inline'>
|
852
|
-
<p>Hostname of the server</p>
|
922
|
+
<div class='inline'><p>Hostname of the server</p>
|
853
923
|
</div>
|
854
924
|
|
855
925
|
</li>
|
@@ -866,8 +936,79 @@
|
|
866
936
|
|
867
937
|
|
868
938
|
—
|
869
|
-
<div class='inline'>
|
870
|
-
|
939
|
+
<div class='inline'><p>Bearer token; optional</p>
|
940
|
+
</div>
|
941
|
+
|
942
|
+
</li>
|
943
|
+
|
944
|
+
<li>
|
945
|
+
|
946
|
+
<span class='name'>user_agent</span>
|
947
|
+
|
948
|
+
|
949
|
+
<span class='type'>(<tt>String</tt>)</span>
|
950
|
+
|
951
|
+
|
952
|
+
<em class="default">(defaults to: <tt>"ShepRubyGem/#{Shep::Version}"</tt>)</em>
|
953
|
+
|
954
|
+
|
955
|
+
—
|
956
|
+
<div class='inline'><p>User-Agent string to use</p>
|
957
|
+
</div>
|
958
|
+
|
959
|
+
</li>
|
960
|
+
|
961
|
+
<li>
|
962
|
+
|
963
|
+
<span class='name'>ua_comment</span>
|
964
|
+
|
965
|
+
|
966
|
+
<span class='type'>(<tt>String</tt>)</span>
|
967
|
+
|
968
|
+
|
969
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
970
|
+
|
971
|
+
|
972
|
+
—
|
973
|
+
<div class='inline'><p>Comment part of User-Agent string</p>
|
974
|
+
</div>
|
975
|
+
|
976
|
+
</li>
|
977
|
+
|
978
|
+
<li>
|
979
|
+
|
980
|
+
<span class='name'>rate_limit_retry</span>
|
981
|
+
|
982
|
+
|
983
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
984
|
+
|
985
|
+
|
986
|
+
<em class="default">(defaults to: <tt>false</tt>)</em>
|
987
|
+
|
988
|
+
|
989
|
+
—
|
990
|
+
<div class='inline'><p>Handle request limits by waiting
|
991
|
+
for the count to reset and trying
|
992
|
+
again.</p>
|
993
|
+
</div>
|
994
|
+
|
995
|
+
</li>
|
996
|
+
|
997
|
+
<li>
|
998
|
+
|
999
|
+
<span class='name'>retry_hook</span>
|
1000
|
+
|
1001
|
+
|
1002
|
+
<span class='type'>(<tt>Proc</tt>)</span>
|
1003
|
+
|
1004
|
+
|
1005
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1006
|
+
|
1007
|
+
|
1008
|
+
—
|
1009
|
+
<div class='inline'><p>One-argument hook function to call
|
1010
|
+
before waiting for the rate limit
|
1011
|
+
to reset</p>
|
871
1012
|
</div>
|
872
1013
|
|
873
1014
|
</li>
|
@@ -884,8 +1025,7 @@
|
|
884
1025
|
|
885
1026
|
|
886
1027
|
—
|
887
|
-
<div class='inline'>
|
888
|
-
<p>The logger or mode; optional</p>
|
1028
|
+
<div class='inline'><p>The logger or mode; optional</p>
|
889
1029
|
</div>
|
890
1030
|
|
891
1031
|
</li>
|
@@ -902,14 +1042,27 @@
|
|
902
1042
|
|
903
1043
|
|
904
1044
|
—
|
905
|
-
<div class='inline'>
|
906
|
-
<
|
1045
|
+
<div class='inline'><p>Enable <code>Net::HTTP</code> debugging;
|
1046
|
+
<strong>insecure!</strong></p>
|
907
1047
|
</div>
|
908
1048
|
|
909
1049
|
</li>
|
910
1050
|
|
911
1051
|
</ul>
|
912
1052
|
|
1053
|
+
<p class="tag_title">Raises:</p>
|
1054
|
+
<ul class="raise">
|
1055
|
+
|
1056
|
+
<li>
|
1057
|
+
|
1058
|
+
|
1059
|
+
<span class='type'>(<tt><span class='object_link'><a href="Error/Caller.html" title="Shep::Error::Caller (class)">Error::Caller</a></span></tt>)</span>
|
1060
|
+
|
1061
|
+
|
1062
|
+
|
1063
|
+
</li>
|
1064
|
+
|
1065
|
+
</ul>
|
913
1066
|
|
914
1067
|
</div><table class="source_code">
|
915
1068
|
<tr>
|
@@ -917,29 +1070,65 @@
|
|
917
1070
|
<pre class="lines">
|
918
1071
|
|
919
1072
|
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
1073
|
+
132
|
1074
|
+
133
|
1075
|
+
134
|
1076
|
+
135
|
1077
|
+
136
|
1078
|
+
137
|
1079
|
+
138
|
1080
|
+
139
|
1081
|
+
140
|
1082
|
+
141
|
1083
|
+
142
|
1084
|
+
143
|
1085
|
+
144
|
1086
|
+
145
|
1087
|
+
146
|
1088
|
+
147
|
1089
|
+
148
|
1090
|
+
149
|
1091
|
+
150
|
1092
|
+
151
|
1093
|
+
152
|
1094
|
+
153
|
1095
|
+
154
|
1096
|
+
155
|
1097
|
+
156
|
1098
|
+
157
|
1099
|
+
158
|
1100
|
+
159</pre>
|
930
1101
|
</td>
|
931
1102
|
<td>
|
932
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
1103
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 132</span>
|
933
1104
|
|
934
1105
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>host:</span><span class='comma'>,</span>
|
935
|
-
<span class='label'>token:</span>
|
936
|
-
<span class='label'>
|
937
|
-
<span class='label'>
|
1106
|
+
<span class='label'>token:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
1107
|
+
<span class='label'>user_agent:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ShepRubyGem/</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../Shep.html" title="Shep (module)">Shep</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Shep.html#Version-constant" title="Shep::Version (constant)">Version</a></span></span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
1108
|
+
<span class='label'>ua_comment:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
1109
|
+
|
1110
|
+
<span class='label'>rate_limit_retry:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
1111
|
+
<span class='label'>retry_hook:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
1112
|
+
|
1113
|
+
<span class='label'>logger:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
1114
|
+
<span class='label'>debug_http:</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
938
1115
|
<span class='ivar'>@host</span> <span class='op'>=</span> <span class='id identifier rubyid_host'>host</span>
|
939
1116
|
<span class='ivar'>@token</span> <span class='op'>=</span> <span class='id identifier rubyid_token'>token</span>
|
940
1117
|
<span class='ivar'>@logger</span> <span class='op'>=</span> <span class='id identifier rubyid_init_logger'>init_logger</span><span class='lparen'>(</span><span class='id identifier rubyid_logger'>logger</span><span class='rparen'>)</span>
|
941
|
-
|
1118
|
+
|
1119
|
+
<span class='ivar'>@user_agent</span> <span class='op'>=</span> <span class='id identifier rubyid_user_agent'>user_agent</span>
|
1120
|
+
<span class='ivar'>@user_agent</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ua_comment'>ua_comment</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_ua_comment'>ua_comment</span>
|
1121
|
+
<span class='ivar'>@user_agent</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
|
1122
|
+
|
1123
|
+
<span class='ivar'>@rate_limit_retry</span> <span class='op'>=</span> <span class='id identifier rubyid_rate_limit_retry'>rate_limit_retry</span>
|
1124
|
+
<span class='ivar'>@retry_hook</span> <span class='op'>=</span> <span class='id identifier rubyid_retry_hook'>retry_hook</span>
|
1125
|
+
|
942
1126
|
<span class='ivar'>@debug_http</span> <span class='op'>=</span> <span class='id identifier rubyid_debug_http'>debug_http</span>
|
1127
|
+
|
1128
|
+
<span class='ivar'>@rate_limit</span> <span class='op'>=</span> <span class='const'>Struct</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:limit</span><span class='comma'>,</span> <span class='symbol'>:remaining</span><span class='comma'>,</span> <span class='symbol'>:reset</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
1129
|
+
|
1130
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="Error.html" title="Shep::Error (class)">Error</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error/Caller.html" title="Shep::Error::Caller (class)">Caller</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>retry_hook: must a callable or nil</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>unless</span>
|
1131
|
+
<span class='ivar'>@retry_hook</span> <span class='op'>==</span> <span class='kw'>nil</span> <span class='op'>||</span> <span class='ivar'>@retry_hook</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:call</span><span class='rparen'>)</span>
|
943
1132
|
<span class='kw'>end</span></pre>
|
944
1133
|
</td>
|
945
1134
|
</tr>
|
@@ -964,8 +1153,7 @@
|
|
964
1153
|
|
965
1154
|
</h3><div class="docstring">
|
966
1155
|
<div class="discussion">
|
967
|
-
|
968
|
-
<p>The Server’s hostname</p>
|
1156
|
+
<p>The Server's hostname</p>
|
969
1157
|
|
970
1158
|
|
971
1159
|
</div>
|
@@ -983,8 +1171,7 @@
|
|
983
1171
|
|
984
1172
|
|
985
1173
|
—
|
986
|
-
<div class='inline'>
|
987
|
-
<p>the current value of host</p>
|
1174
|
+
<div class='inline'><p>the current value of host</p>
|
988
1175
|
</div>
|
989
1176
|
|
990
1177
|
</li>
|
@@ -997,12 +1184,12 @@
|
|
997
1184
|
<pre class="lines">
|
998
1185
|
|
999
1186
|
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1187
|
+
90
|
1188
|
+
91
|
1189
|
+
92</pre>
|
1003
1190
|
</td>
|
1004
1191
|
<td>
|
1005
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
1192
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 90</span>
|
1006
1193
|
|
1007
1194
|
<span class='kw'>def</span> <span class='id identifier rubyid_host'>host</span>
|
1008
1195
|
<span class='ivar'>@host</span>
|
@@ -1025,8 +1212,7 @@
|
|
1025
1212
|
|
1026
1213
|
</h3><div class="docstring">
|
1027
1214
|
<div class="discussion">
|
1028
|
-
|
1029
|
-
<p>The logger object</p>
|
1215
|
+
<p>The logger object</p>
|
1030
1216
|
|
1031
1217
|
|
1032
1218
|
</div>
|
@@ -1044,8 +1230,7 @@
|
|
1044
1230
|
|
1045
1231
|
|
1046
1232
|
—
|
1047
|
-
<div class='inline'>
|
1048
|
-
<p>the current value of logger</p>
|
1233
|
+
<div class='inline'><p>the current value of logger</p>
|
1049
1234
|
</div>
|
1050
1235
|
|
1051
1236
|
</li>
|
@@ -1058,12 +1243,12 @@
|
|
1058
1243
|
<pre class="lines">
|
1059
1244
|
|
1060
1245
|
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1246
|
+
90
|
1247
|
+
91
|
1248
|
+
92</pre>
|
1064
1249
|
</td>
|
1065
1250
|
<td>
|
1066
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
1251
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 90</span>
|
1067
1252
|
|
1068
1253
|
<span class='kw'>def</span> <span class='id identifier rubyid_logger'>logger</span>
|
1069
1254
|
<span class='ivar'>@logger</span>
|
@@ -1073,6 +1258,65 @@
|
|
1073
1258
|
</table>
|
1074
1259
|
</div>
|
1075
1260
|
|
1261
|
+
|
1262
|
+
<span id=""></span>
|
1263
|
+
<div class="method_details ">
|
1264
|
+
<h3 class="signature " id="user_agent-instance_method">
|
1265
|
+
|
1266
|
+
#<strong>user_agent</strong> ⇒ <tt>String</tt> <span class="extras">(readonly)</span>
|
1267
|
+
|
1268
|
+
|
1269
|
+
|
1270
|
+
|
1271
|
+
|
1272
|
+
</h3><div class="docstring">
|
1273
|
+
<div class="discussion">
|
1274
|
+
<p>User-Agent string; frozen</p>
|
1275
|
+
|
1276
|
+
|
1277
|
+
</div>
|
1278
|
+
</div>
|
1279
|
+
<div class="tags">
|
1280
|
+
|
1281
|
+
<p class="tag_title">Returns:</p>
|
1282
|
+
<ul class="return">
|
1283
|
+
|
1284
|
+
<li>
|
1285
|
+
|
1286
|
+
|
1287
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1288
|
+
|
1289
|
+
|
1290
|
+
|
1291
|
+
—
|
1292
|
+
<div class='inline'><p>the current value of user_agent</p>
|
1293
|
+
</div>
|
1294
|
+
|
1295
|
+
</li>
|
1296
|
+
|
1297
|
+
</ul>
|
1298
|
+
|
1299
|
+
</div><table class="source_code">
|
1300
|
+
<tr>
|
1301
|
+
<td>
|
1302
|
+
<pre class="lines">
|
1303
|
+
|
1304
|
+
|
1305
|
+
90
|
1306
|
+
91
|
1307
|
+
92</pre>
|
1308
|
+
</td>
|
1309
|
+
<td>
|
1310
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 90</span>
|
1311
|
+
|
1312
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_user_agent'>user_agent</span>
|
1313
|
+
<span class='ivar'>@user_agent</span>
|
1314
|
+
<span class='kw'>end</span></pre>
|
1315
|
+
</td>
|
1316
|
+
</tr>
|
1317
|
+
</table>
|
1318
|
+
</div>
|
1319
|
+
|
1076
1320
|
</div>
|
1077
1321
|
|
1078
1322
|
|
@@ -1091,8 +1335,7 @@
|
|
1091
1335
|
|
1092
1336
|
</h3><div class="docstring">
|
1093
1337
|
<div class="discussion">
|
1094
|
-
|
1095
|
-
<p>Delete the status at ID.</p>
|
1338
|
+
<p>Delete the status at ID.</p>
|
1096
1339
|
|
1097
1340
|
|
1098
1341
|
</div>
|
@@ -1110,8 +1353,7 @@
|
|
1110
1353
|
|
1111
1354
|
|
1112
1355
|
—
|
1113
|
-
<div class='inline'>
|
1114
|
-
<p>the deleted status</p>
|
1356
|
+
<div class='inline'><p>the deleted status</p>
|
1115
1357
|
</div>
|
1116
1358
|
|
1117
1359
|
</li>
|
@@ -1131,10 +1373,10 @@
|
|
1131
1373
|
<pre class="lines">
|
1132
1374
|
|
1133
1375
|
|
1134
|
-
|
1376
|
+
823</pre>
|
1135
1377
|
</td>
|
1136
1378
|
<td>
|
1137
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
1379
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 823</span>
|
1138
1380
|
|
1139
1381
|
<span class='kw'>def</span> <span class='id identifier rubyid_delete_status'>delete_status</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='id identifier rubyid_rest_delete'>rest_delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>statuses/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="Entity.html" title="Shep::Entity (class)">Entity</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Entity/Status.html" title="Shep::Entity::Status (class)">Status</a></span></span><span class='rparen'>)</span></pre>
|
1140
1382
|
</td>
|
@@ -1153,10 +1395,11 @@
|
|
1153
1395
|
|
1154
1396
|
</h3><div class="docstring">
|
1155
1397
|
<div class="discussion">
|
1156
|
-
|
1157
|
-
<p>Dismiss the notification with the given ID.</p>
|
1398
|
+
<p>Dismiss the notification with the given ID.</p>
|
1158
1399
|
|
1159
|
-
<p>Warning: due to the complexity involved in repeatably sending a
|
1400
|
+
<p>Warning: due to the complexity involved in repeatably sending a
|
1401
|
+
notification to an account, there is limited test coverage for
|
1402
|
+
this method.</p>
|
1160
1403
|
|
1161
1404
|
|
1162
1405
|
</div>
|
@@ -1177,14 +1420,14 @@
|
|
1177
1420
|
<pre class="lines">
|
1178
1421
|
|
1179
1422
|
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1423
|
+
832
|
1424
|
+
833
|
1425
|
+
834
|
1426
|
+
835
|
1427
|
+
836</pre>
|
1185
1428
|
</td>
|
1186
1429
|
<td>
|
1187
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
1430
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 832</span>
|
1188
1431
|
|
1189
1432
|
<span class='kw'>def</span> <span class='id identifier rubyid_dismiss_notification'>dismiss_notification</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
1190
1433
|
<span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='id identifier rubyid_rest_uri'>rest_uri</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>notifications/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/dismiss</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
@@ -1207,8 +1450,7 @@
|
|
1207
1450
|
|
1208
1451
|
</h3><div class="docstring">
|
1209
1452
|
<div class="discussion">
|
1210
|
-
|
1211
|
-
<p>Retrieve each Entity::Account that boosted the given status.</p>
|
1453
|
+
<p>Retrieve each Entity::Account that boosted the given status.</p>
|
1212
1454
|
|
1213
1455
|
|
1214
1456
|
</div>
|
@@ -1229,8 +1471,7 @@
|
|
1229
1471
|
|
1230
1472
|
|
1231
1473
|
—
|
1232
|
-
<div class='inline'>
|
1233
|
-
<p>Maximum number of items to retrieve</p>
|
1474
|
+
<div class='inline'><p>Maximum number of items to retrieve</p>
|
1234
1475
|
</div>
|
1235
1476
|
|
1236
1477
|
</li>
|
@@ -1276,8 +1517,7 @@
|
|
1276
1517
|
|
1277
1518
|
|
1278
1519
|
—
|
1279
|
-
<div class='inline'>
|
1280
|
-
<p>if block is not given, otherwise self</p>
|
1520
|
+
<div class='inline'><p>if block is not given, otherwise self</p>
|
1281
1521
|
</div>
|
1282
1522
|
|
1283
1523
|
</li>
|
@@ -1297,16 +1537,16 @@
|
|
1297
1537
|
<pre class="lines">
|
1298
1538
|
|
1299
1539
|
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1540
|
+
574
|
1541
|
+
575
|
1542
|
+
576
|
1543
|
+
577
|
1544
|
+
578
|
1545
|
+
579
|
1546
|
+
580</pre>
|
1307
1547
|
</td>
|
1308
1548
|
<td>
|
1309
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
1549
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 574</span>
|
1310
1550
|
|
1311
1551
|
<span class='kw'>def</span> <span class='id identifier rubyid_each_boost_acct'>each_boost_acct</span><span class='lparen'>(</span><span class='id identifier rubyid_status_id'>status_id</span><span class='comma'>,</span>
|
1312
1552
|
<span class='label'>limit:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
@@ -1331,8 +1571,7 @@
|
|
1331
1571
|
|
1332
1572
|
</h3><div class="docstring">
|
1333
1573
|
<div class="discussion">
|
1334
|
-
|
1335
|
-
<p>Retrieve each account that favourited the given status.</p>
|
1574
|
+
<p>Retrieve each account that favourited the given status.</p>
|
1336
1575
|
|
1337
1576
|
|
1338
1577
|
</div>
|
@@ -1353,8 +1592,7 @@
|
|
1353
1592
|
|
1354
1593
|
|
1355
1594
|
—
|
1356
|
-
<div class='inline'>
|
1357
|
-
<p>Maximum number of items to retrieve</p>
|
1595
|
+
<div class='inline'><p>Maximum number of items to retrieve</p>
|
1358
1596
|
</div>
|
1359
1597
|
|
1360
1598
|
</li>
|
@@ -1400,8 +1638,7 @@
|
|
1400
1638
|
|
1401
1639
|
|
1402
1640
|
—
|
1403
|
-
<div class='inline'>
|
1404
|
-
<p>if block is not given, otherwise self</p>
|
1641
|
+
<div class='inline'><p>if block is not given, otherwise self</p>
|
1405
1642
|
</div>
|
1406
1643
|
|
1407
1644
|
</li>
|
@@ -1421,16 +1658,16 @@
|
|
1421
1658
|
<pre class="lines">
|
1422
1659
|
|
1423
1660
|
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1661
|
+
594
|
1662
|
+
595
|
1663
|
+
596
|
1664
|
+
597
|
1665
|
+
598
|
1666
|
+
599
|
1667
|
+
600</pre>
|
1431
1668
|
</td>
|
1432
1669
|
<td>
|
1433
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
1670
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 594</span>
|
1434
1671
|
|
1435
1672
|
<span class='kw'>def</span> <span class='id identifier rubyid_each_fave_acct'>each_fave_acct</span><span class='lparen'>(</span><span class='id identifier rubyid_status_id'>status_id</span><span class='comma'>,</span>
|
1436
1673
|
<span class='label'>limit:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
@@ -1455,8 +1692,7 @@
|
|
1455
1692
|
|
1456
1693
|
</h3><div class="docstring">
|
1457
1694
|
<div class="discussion">
|
1458
|
-
|
1459
|
-
<p>Retrieve the follower list of an account.</p>
|
1695
|
+
<p>Retrieve the follower list of an account.</p>
|
1460
1696
|
|
1461
1697
|
<p>As of Mastodon 4.0, no longer requires a token.</p>
|
1462
1698
|
|
@@ -1477,8 +1713,7 @@
|
|
1477
1713
|
|
1478
1714
|
|
1479
1715
|
—
|
1480
|
-
<div class='inline'>
|
1481
|
-
<p>The account</p>
|
1716
|
+
<div class='inline'><p>The account</p>
|
1482
1717
|
</div>
|
1483
1718
|
|
1484
1719
|
</li>
|
@@ -1495,8 +1730,7 @@
|
|
1495
1730
|
|
1496
1731
|
|
1497
1732
|
—
|
1498
|
-
<div class='inline'>
|
1499
|
-
<p>Maximum number of items to retrieve</p>
|
1733
|
+
<div class='inline'><p>Maximum number of items to retrieve</p>
|
1500
1734
|
</div>
|
1501
1735
|
|
1502
1736
|
</li>
|
@@ -1514,8 +1748,7 @@
|
|
1514
1748
|
|
1515
1749
|
|
1516
1750
|
—
|
1517
|
-
<div class='inline'>
|
1518
|
-
<p>Optional; applied to each item</p>
|
1751
|
+
<div class='inline'><p>Optional; applied to each item</p>
|
1519
1752
|
</div>
|
1520
1753
|
|
1521
1754
|
</li>
|
@@ -1547,8 +1780,7 @@
|
|
1547
1780
|
|
1548
1781
|
|
1549
1782
|
—
|
1550
|
-
<div class='inline'>
|
1551
|
-
<p>if block is not given, otherwise self</p>
|
1783
|
+
<div class='inline'><p>if block is not given, otherwise self</p>
|
1552
1784
|
</div>
|
1553
1785
|
|
1554
1786
|
</li>
|
@@ -1568,16 +1800,16 @@
|
|
1568
1800
|
<pre class="lines">
|
1569
1801
|
|
1570
1802
|
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1803
|
+
366
|
1804
|
+
367
|
1805
|
+
368
|
1806
|
+
369
|
1807
|
+
370
|
1808
|
+
371
|
1809
|
+
372</pre>
|
1578
1810
|
</td>
|
1579
1811
|
<td>
|
1580
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
1812
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 366</span>
|
1581
1813
|
|
1582
1814
|
<span class='kw'>def</span> <span class='id identifier rubyid_each_follower'>each_follower</span><span class='lparen'>(</span><span class='id identifier rubyid_account_id'>account_id</span><span class='comma'>,</span>
|
1583
1815
|
<span class='label'>limit:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
@@ -1602,8 +1834,7 @@
|
|
1602
1834
|
|
1603
1835
|
</h3><div class="docstring">
|
1604
1836
|
<div class="discussion">
|
1605
|
-
|
1606
|
-
<p>Retrieve the list of accounts this account follows</p>
|
1837
|
+
<p>Retrieve the list of accounts this account follows</p>
|
1607
1838
|
|
1608
1839
|
|
1609
1840
|
</div>
|
@@ -1622,8 +1853,7 @@
|
|
1622
1853
|
|
1623
1854
|
|
1624
1855
|
—
|
1625
|
-
<div class='inline'>
|
1626
|
-
<p>The account</p>
|
1856
|
+
<div class='inline'><p>The account</p>
|
1627
1857
|
</div>
|
1628
1858
|
|
1629
1859
|
</li>
|
@@ -1640,8 +1870,7 @@
|
|
1640
1870
|
|
1641
1871
|
|
1642
1872
|
—
|
1643
|
-
<div class='inline'>
|
1644
|
-
<p>Maximum number of items to retrieve</p>
|
1873
|
+
<div class='inline'><p>Maximum number of items to retrieve</p>
|
1645
1874
|
</div>
|
1646
1875
|
|
1647
1876
|
</li>
|
@@ -1659,8 +1888,7 @@
|
|
1659
1888
|
|
1660
1889
|
|
1661
1890
|
—
|
1662
|
-
<div class='inline'>
|
1663
|
-
<p>Optional; applied to each item</p>
|
1891
|
+
<div class='inline'><p>Optional; applied to each item</p>
|
1664
1892
|
</div>
|
1665
1893
|
|
1666
1894
|
</li>
|
@@ -1692,8 +1920,7 @@
|
|
1692
1920
|
|
1693
1921
|
|
1694
1922
|
—
|
1695
|
-
<div class='inline'>
|
1696
|
-
<p>if block is not given, otherwise self</p>
|
1923
|
+
<div class='inline'><p>if block is not given, otherwise self</p>
|
1697
1924
|
</div>
|
1698
1925
|
|
1699
1926
|
</li>
|
@@ -1713,16 +1940,16 @@
|
|
1713
1940
|
<pre class="lines">
|
1714
1941
|
|
1715
1942
|
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1943
|
+
386
|
1944
|
+
387
|
1945
|
+
388
|
1946
|
+
389
|
1947
|
+
390
|
1948
|
+
391
|
1949
|
+
392</pre>
|
1723
1950
|
</td>
|
1724
1951
|
<td>
|
1725
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
1952
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 386</span>
|
1726
1953
|
|
1727
1954
|
<span class='kw'>def</span> <span class='id identifier rubyid_each_following'>each_following</span><span class='lparen'>(</span><span class='id identifier rubyid_account_id'>account_id</span><span class='comma'>,</span>
|
1728
1955
|
<span class='label'>limit:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
@@ -1739,7 +1966,7 @@
|
|
1739
1966
|
<div class="method_details ">
|
1740
1967
|
<h3 class="signature " id="each_home_status-instance_method">
|
1741
1968
|
|
1742
|
-
#<strong>each_home_status</strong>(limit: nil, local: false, remote: false, only_media: false) {|item| ... } ⇒ <tt>Enumerator</tt>
|
1969
|
+
#<strong>each_home_status</strong>(limit: nil, local: false, max_id: "", remote: false, only_media: false) {|item| ... } ⇒ <tt>Enumerator</tt>
|
1743
1970
|
|
1744
1971
|
|
1745
1972
|
|
@@ -1747,8 +1974,7 @@
|
|
1747
1974
|
|
1748
1975
|
</h3><div class="docstring">
|
1749
1976
|
<div class="discussion">
|
1750
|
-
|
1751
|
-
<p>Retrieve each Entity::Status in the home timeline.</p>
|
1977
|
+
<p>Retrieve each Entity::Status in the home timeline.</p>
|
1752
1978
|
|
1753
1979
|
<p>Requires token.</p>
|
1754
1980
|
|
@@ -1771,8 +1997,24 @@
|
|
1771
1997
|
|
1772
1998
|
|
1773
1999
|
—
|
1774
|
-
<div class='inline'>
|
1775
|
-
|
2000
|
+
<div class='inline'><p>maximum number of items to retrieve</p>
|
2001
|
+
</div>
|
2002
|
+
|
2003
|
+
</li>
|
2004
|
+
|
2005
|
+
<li>
|
2006
|
+
|
2007
|
+
<span class='name'>max_id</span>
|
2008
|
+
|
2009
|
+
|
2010
|
+
<span class='type'>(<tt>String</tt>)</span>
|
2011
|
+
|
2012
|
+
|
2013
|
+
<em class="default">(defaults to: <tt>""</tt>)</em>
|
2014
|
+
|
2015
|
+
|
2016
|
+
—
|
2017
|
+
<div class='inline'><p>retrieve results older than this ID.</p>
|
1776
2018
|
</div>
|
1777
2019
|
|
1778
2020
|
</li>
|
@@ -1789,8 +2031,7 @@
|
|
1789
2031
|
|
1790
2032
|
|
1791
2033
|
—
|
1792
|
-
<div class='inline'>
|
1793
|
-
<p>,</p>
|
2034
|
+
<div class='inline'><p>retrieve only local statuses</p>
|
1794
2035
|
</div>
|
1795
2036
|
|
1796
2037
|
</li>
|
@@ -1807,8 +2048,7 @@
|
|
1807
2048
|
|
1808
2049
|
|
1809
2050
|
—
|
1810
|
-
<div class='inline'>
|
1811
|
-
<p>,</p>
|
2051
|
+
<div class='inline'><p>retrieve only remote statuses</p>
|
1812
2052
|
</div>
|
1813
2053
|
|
1814
2054
|
</li>
|
@@ -1825,8 +2065,7 @@
|
|
1825
2065
|
|
1826
2066
|
|
1827
2067
|
—
|
1828
|
-
<div class='inline'>
|
1829
|
-
<p>,</p>
|
2068
|
+
<div class='inline'><p>retrieve only media status</p>
|
1830
2069
|
</div>
|
1831
2070
|
|
1832
2071
|
</li>
|
@@ -1872,8 +2111,7 @@
|
|
1872
2111
|
|
1873
2112
|
|
1874
2113
|
—
|
1875
|
-
<div class='inline'>
|
1876
|
-
<p>if block is not given, otherwise self</p>
|
2114
|
+
<div class='inline'><p>if block is not given, otherwise self</p>
|
1877
2115
|
</div>
|
1878
2116
|
|
1879
2117
|
</li>
|
@@ -1893,20 +2131,22 @@
|
|
1893
2131
|
<pre class="lines">
|
1894
2132
|
|
1895
2133
|
|
1896
|
-
|
1897
|
-
|
1898
|
-
|
1899
|
-
|
1900
|
-
|
1901
|
-
|
1902
|
-
|
1903
|
-
|
2134
|
+
551
|
2135
|
+
552
|
2136
|
+
553
|
2137
|
+
554
|
2138
|
+
555
|
2139
|
+
556
|
2140
|
+
557
|
2141
|
+
558
|
2142
|
+
559</pre>
|
1904
2143
|
</td>
|
1905
2144
|
<td>
|
1906
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
2145
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 551</span>
|
1907
2146
|
|
1908
2147
|
<span class='kw'>def</span> <span class='id identifier rubyid_each_home_status'>each_home_status</span><span class='lparen'>(</span><span class='label'>limit:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
1909
2148
|
<span class='label'>local:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
2149
|
+
<span class='label'>max_id:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
1910
2150
|
<span class='label'>remote:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
1911
2151
|
<span class='label'>only_media:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
1912
2152
|
<span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
@@ -1929,8 +2169,18 @@
|
|
1929
2169
|
|
1930
2170
|
</h3><div class="docstring">
|
1931
2171
|
<div class="discussion">
|
1932
|
-
|
1933
|
-
|
2172
|
+
<p>Retrieve each notification.</p>
|
2173
|
+
|
2174
|
+
<p>Requires a bearer token.</p>
|
2175
|
+
|
2176
|
+
<p>Notification types are indicated by of the following symbols:</p>
|
2177
|
+
|
2178
|
+
<p><code>:mention</code>, <code>:status</code>, <code>:reblog</code>, <code>:follow</code>, <code>:follow_request</code>
|
2179
|
+
<code>:favourite</code>, <code>:poll</code>, <code>:update</code>, <code>:admin.sign_up</code>, or
|
2180
|
+
<code>:admin.report</code></p>
|
2181
|
+
|
2182
|
+
<p>This method will throw an <code>Error::Caller</code> exception if an
|
2183
|
+
unknown value is used.</p>
|
1934
2184
|
|
1935
2185
|
|
1936
2186
|
</div>
|
@@ -1951,8 +2201,8 @@
|
|
1951
2201
|
|
1952
2202
|
|
1953
2203
|
—
|
1954
|
-
<div class='inline'>
|
1955
|
-
|
2204
|
+
<div class='inline'><p>list of notifications types to
|
2205
|
+
enumerate; others are ignoredn</p>
|
1956
2206
|
</div>
|
1957
2207
|
|
1958
2208
|
</li>
|
@@ -1969,8 +2219,7 @@
|
|
1969
2219
|
|
1970
2220
|
|
1971
2221
|
—
|
1972
|
-
<div class='inline'>
|
1973
|
-
<p>types of notifications to exclude</p>
|
2222
|
+
<div class='inline'><p>types of notifications to exclude</p>
|
1974
2223
|
</div>
|
1975
2224
|
|
1976
2225
|
</li>
|
@@ -1987,8 +2236,7 @@
|
|
1987
2236
|
|
1988
2237
|
|
1989
2238
|
—
|
1990
|
-
<div class='inline'>
|
1991
|
-
<p>Maximum number of items to retrieve</p>
|
2239
|
+
<div class='inline'><p>Maximum number of items to retrieve</p>
|
1992
2240
|
</div>
|
1993
2241
|
|
1994
2242
|
</li>
|
@@ -2005,8 +2253,8 @@
|
|
2005
2253
|
|
2006
2254
|
|
2007
2255
|
—
|
2008
|
-
<div class='inline'>
|
2009
|
-
|
2256
|
+
<div class='inline'><p>Only retrieve notifications from
|
2257
|
+
the account with this ID.</p>
|
2010
2258
|
</div>
|
2011
2259
|
|
2012
2260
|
</li>
|
@@ -2024,8 +2272,7 @@
|
|
2024
2272
|
|
2025
2273
|
|
2026
2274
|
—
|
2027
|
-
<div class='inline'>
|
2028
|
-
<p>Applied to each Notification</p>
|
2275
|
+
<div class='inline'><p>Applied to each Notification</p>
|
2029
2276
|
</div>
|
2030
2277
|
|
2031
2278
|
</li>
|
@@ -2057,8 +2304,7 @@
|
|
2057
2304
|
|
2058
2305
|
|
2059
2306
|
—
|
2060
|
-
<div class='inline'>
|
2061
|
-
<p>if block is not given, otherwise self</p>
|
2307
|
+
<div class='inline'><p>if block is not given, otherwise self</p>
|
2062
2308
|
</div>
|
2063
2309
|
|
2064
2310
|
</li>
|
@@ -2078,30 +2324,34 @@
|
|
2078
2324
|
<pre class="lines">
|
2079
2325
|
|
2080
2326
|
|
2081
|
-
|
2082
|
-
|
2083
|
-
|
2084
|
-
|
2085
|
-
|
2086
|
-
|
2087
|
-
|
2088
|
-
|
2089
|
-
|
2090
|
-
|
2091
|
-
|
2092
|
-
|
2093
|
-
|
2094
|
-
|
2095
|
-
|
2096
|
-
|
2097
|
-
|
2098
|
-
|
2099
|
-
|
2100
|
-
|
2101
|
-
|
2327
|
+
634
|
2328
|
+
635
|
2329
|
+
636
|
2330
|
+
637
|
2331
|
+
638
|
2332
|
+
639
|
2333
|
+
640
|
2334
|
+
641
|
2335
|
+
642
|
2336
|
+
643
|
2337
|
+
644
|
2338
|
+
645
|
2339
|
+
646
|
2340
|
+
647
|
2341
|
+
648
|
2342
|
+
649
|
2343
|
+
650
|
2344
|
+
651
|
2345
|
+
652
|
2346
|
+
653
|
2347
|
+
654
|
2348
|
+
655
|
2349
|
+
656
|
2350
|
+
657
|
2351
|
+
658</pre>
|
2102
2352
|
</td>
|
2103
2353
|
<td>
|
2104
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
2354
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 634</span>
|
2105
2355
|
|
2106
2356
|
<span class='kw'>def</span> <span class='id identifier rubyid_each_notification'>each_notification</span><span class='lparen'>(</span><span class='label'>types:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
2107
2357
|
<span class='label'>exclude_types:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
@@ -2112,10 +2362,14 @@
|
|
2112
2362
|
</span><span class='tstring_content'>favourite</span><span class='words_sep'> </span><span class='tstring_content'>poll</span><span class='words_sep'> </span><span class='tstring_content'>update</span><span class='words_sep'> </span><span class='tstring_content'>admin.sign_up</span><span class='words_sep'>
|
2113
2363
|
</span><span class='tstring_content'>admin.report</span><span class='tstring_end'>}</span></span>
|
2114
2364
|
|
2115
|
-
<span class='comment'>#
|
2116
|
-
</span> <span class='id identifier rubyid_types'>types</span><span class='period'>.</span><span class='id identifier
|
2117
|
-
|
2118
|
-
|
2365
|
+
<span class='comment'># Remove duplicates and convert strings to symbols
|
2366
|
+
</span> <span class='lbracket'>[</span><span class='id identifier rubyid_types'>types</span><span class='comma'>,</span> <span class='id identifier rubyid_exclude_types'>exclude_types</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_param'>param</span><span class='op'>|</span>
|
2367
|
+
<span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_map!'>map!</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span> <span class='id identifier rubyid_item'>item</span><span class='period'>.</span><span class='id identifier rubyid_intern'>intern</span><span class='rbrace'>}</span>
|
2368
|
+
<span class='id identifier rubyid_param'>param</span><span class='period'>.</span><span class='id identifier rubyid_uniq!'>uniq!</span>
|
2369
|
+
<span class='rbrace'>}</span>
|
2370
|
+
|
2371
|
+
<span class='comment'># Now, ensure there are no incorrect notification types.
|
2372
|
+
</span> <span class='lparen'>(</span><span class='id identifier rubyid_types'>types</span> <span class='op'>+</span> <span class='id identifier rubyid_exclude_types'>exclude_types</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_filter'>filter</span><span class='op'>|</span>
|
2119
2373
|
<span class='id identifier rubyid_assert'>assert</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Unknown notification type: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_filter'>filter</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span>
|
2120
2374
|
<span class='id identifier rubyid_allowed_notifications'>allowed_notifications</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_filter'>filter</span><span class='period'>.</span><span class='id identifier rubyid_intern'>intern</span><span class='rparen'>)</span>
|
2121
2375
|
<span class='rbrace'>}</span>
|
@@ -2132,7 +2386,7 @@
|
|
2132
2386
|
<div class="method_details ">
|
2133
2387
|
<h3 class="signature " id="each_public_status-instance_method">
|
2134
2388
|
|
2135
|
-
#<strong>each_public_status</strong>(limit: nil, local: false, remote: false, only_media: false) {|item| ... } ⇒ <tt>Enumerator</tt>
|
2389
|
+
#<strong>each_public_status</strong>(limit: nil, max_id: "", local: false, remote: false, only_media: false) {|item| ... } ⇒ <tt>Enumerator</tt>
|
2136
2390
|
|
2137
2391
|
|
2138
2392
|
|
@@ -2140,10 +2394,9 @@
|
|
2140
2394
|
|
2141
2395
|
</h3><div class="docstring">
|
2142
2396
|
<div class="discussion">
|
2143
|
-
|
2144
|
-
<p>Retrieve the instance’s public timeline(s)</p>
|
2397
|
+
<p>Retrieve the instance's public timeline(s)</p>
|
2145
2398
|
|
2146
|
-
<p>May require a token depending on the instance
|
2399
|
+
<p>May require a token depending on the instance's settings.</p>
|
2147
2400
|
|
2148
2401
|
|
2149
2402
|
</div>
|
@@ -2164,8 +2417,24 @@
|
|
2164
2417
|
|
2165
2418
|
|
2166
2419
|
—
|
2167
|
-
<div class='inline'>
|
2168
|
-
|
2420
|
+
<div class='inline'><p>Max. items to retrieve.</p>
|
2421
|
+
</div>
|
2422
|
+
|
2423
|
+
</li>
|
2424
|
+
|
2425
|
+
<li>
|
2426
|
+
|
2427
|
+
<span class='name'>max_id</span>
|
2428
|
+
|
2429
|
+
|
2430
|
+
<span class='type'>(<tt>String</tt>)</span>
|
2431
|
+
|
2432
|
+
|
2433
|
+
<em class="default">(defaults to: <tt>""</tt>)</em>
|
2434
|
+
|
2435
|
+
|
2436
|
+
—
|
2437
|
+
<div class='inline'><p>retrieve results older than this ID.</p>
|
2169
2438
|
</div>
|
2170
2439
|
|
2171
2440
|
</li>
|
@@ -2182,8 +2451,7 @@
|
|
2182
2451
|
|
2183
2452
|
|
2184
2453
|
—
|
2185
|
-
<div class='inline'>
|
2186
|
-
<p>Retrieve only local statuses</p>
|
2454
|
+
<div class='inline'><p>Retrieve only local statuses</p>
|
2187
2455
|
</div>
|
2188
2456
|
|
2189
2457
|
</li>
|
@@ -2200,8 +2468,7 @@
|
|
2200
2468
|
|
2201
2469
|
|
2202
2470
|
—
|
2203
|
-
<div class='inline'>
|
2204
|
-
<p>Retrieve only remote statuses</p>
|
2471
|
+
<div class='inline'><p>Retrieve only remote statuses</p>
|
2205
2472
|
</div>
|
2206
2473
|
|
2207
2474
|
</li>
|
@@ -2218,8 +2485,7 @@
|
|
2218
2485
|
|
2219
2486
|
|
2220
2487
|
—
|
2221
|
-
<div class='inline'>
|
2222
|
-
<p>Retrieve only statuses with media</p>
|
2488
|
+
<div class='inline'><p>Retrieve only statuses with media</p>
|
2223
2489
|
</div>
|
2224
2490
|
|
2225
2491
|
</li>
|
@@ -2237,8 +2503,7 @@
|
|
2237
2503
|
|
2238
2504
|
|
2239
2505
|
—
|
2240
|
-
<div class='inline'>
|
2241
|
-
<p>Optional; applied to each item</p>
|
2506
|
+
<div class='inline'><p>Optional; applied to each item</p>
|
2242
2507
|
</div>
|
2243
2508
|
|
2244
2509
|
</li>
|
@@ -2270,8 +2535,7 @@
|
|
2270
2535
|
|
2271
2536
|
|
2272
2537
|
—
|
2273
|
-
<div class='inline'>
|
2274
|
-
<p>if block is not given, otherwise self</p>
|
2538
|
+
<div class='inline'><p>if block is not given, otherwise self</p>
|
2275
2539
|
</div>
|
2276
2540
|
|
2277
2541
|
</li>
|
@@ -2291,19 +2555,21 @@
|
|
2291
2555
|
<pre class="lines">
|
2292
2556
|
|
2293
2557
|
|
2294
|
-
|
2295
|
-
|
2296
|
-
|
2297
|
-
|
2298
|
-
|
2299
|
-
|
2300
|
-
|
2301
|
-
|
2558
|
+
456
|
2559
|
+
457
|
2560
|
+
458
|
2561
|
+
459
|
2562
|
+
460
|
2563
|
+
461
|
2564
|
+
462
|
2565
|
+
463
|
2566
|
+
464</pre>
|
2302
2567
|
</td>
|
2303
2568
|
<td>
|
2304
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
2569
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 456</span>
|
2305
2570
|
|
2306
2571
|
<span class='kw'>def</span> <span class='id identifier rubyid_each_public_status'>each_public_status</span><span class='lparen'>(</span><span class='label'>limit:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
2572
|
+
<span class='label'>max_id:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
2307
2573
|
<span class='label'>local:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
2308
2574
|
<span class='label'>remote:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
2309
2575
|
<span class='label'>only_media:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
@@ -2319,7 +2585,7 @@
|
|
2319
2585
|
<div class="method_details ">
|
2320
2586
|
<h3 class="signature " id="each_status-instance_method">
|
2321
2587
|
|
2322
|
-
#<strong>each_status</strong>(account_id, limit: nil, only_media: false, exclude_replies: false, exclude_reblogs: false, pinned: false, tagged: nil) {|item| ... } ⇒ <tt>Enumerator</tt>
|
2588
|
+
#<strong>each_status</strong>(account_id, limit: nil, max_id: "", only_media: false, exclude_replies: false, exclude_reblogs: false, pinned: false, tagged: nil) {|item| ... } ⇒ <tt>Enumerator</tt>
|
2323
2589
|
|
2324
2590
|
|
2325
2591
|
|
@@ -2327,8 +2593,7 @@
|
|
2327
2593
|
|
2328
2594
|
</h3><div class="docstring">
|
2329
2595
|
<div class="discussion">
|
2330
|
-
|
2331
|
-
<p>Retrieve the account’s statuses</p>
|
2596
|
+
<p>Retrieve the account's statuses</p>
|
2332
2597
|
|
2333
2598
|
|
2334
2599
|
</div>
|
@@ -2347,8 +2612,7 @@
|
|
2347
2612
|
|
2348
2613
|
|
2349
2614
|
—
|
2350
|
-
<div class='inline'>
|
2351
|
-
<p>The ID of the account</p>
|
2615
|
+
<div class='inline'><p>The ID of the account</p>
|
2352
2616
|
</div>
|
2353
2617
|
|
2354
2618
|
</li>
|
@@ -2365,8 +2629,25 @@
|
|
2365
2629
|
|
2366
2630
|
|
2367
2631
|
—
|
2368
|
-
<div class='inline'>
|
2369
|
-
|
2632
|
+
<div class='inline'><p>Maximum number of accounts to
|
2633
|
+
retrieve</p>
|
2634
|
+
</div>
|
2635
|
+
|
2636
|
+
</li>
|
2637
|
+
|
2638
|
+
<li>
|
2639
|
+
|
2640
|
+
<span class='name'>max_id</span>
|
2641
|
+
|
2642
|
+
|
2643
|
+
<span class='type'>(<tt>String</tt>)</span>
|
2644
|
+
|
2645
|
+
|
2646
|
+
<em class="default">(defaults to: <tt>""</tt>)</em>
|
2647
|
+
|
2648
|
+
|
2649
|
+
—
|
2650
|
+
<div class='inline'><p>retrieve results older than this ID.</p>
|
2370
2651
|
</div>
|
2371
2652
|
|
2372
2653
|
</li>
|
@@ -2383,8 +2664,8 @@
|
|
2383
2664
|
|
2384
2665
|
|
2385
2666
|
—
|
2386
|
-
<div class='inline'>
|
2387
|
-
|
2667
|
+
<div class='inline'><p>If true, filter for statuses
|
2668
|
+
with media</p>
|
2388
2669
|
</div>
|
2389
2670
|
|
2390
2671
|
</li>
|
@@ -2401,8 +2682,7 @@
|
|
2401
2682
|
|
2402
2683
|
|
2403
2684
|
—
|
2404
|
-
<div class='inline'>
|
2405
|
-
<p>If true, exclude replies</p>
|
2685
|
+
<div class='inline'><p>If true, exclude replies</p>
|
2406
2686
|
</div>
|
2407
2687
|
|
2408
2688
|
</li>
|
@@ -2419,8 +2699,7 @@
|
|
2419
2699
|
|
2420
2700
|
|
2421
2701
|
—
|
2422
|
-
<div class='inline'>
|
2423
|
-
<p>If true, exclude boosts</p>
|
2702
|
+
<div class='inline'><p>If true, exclude boosts</p>
|
2424
2703
|
</div>
|
2425
2704
|
|
2426
2705
|
</li>
|
@@ -2437,8 +2716,8 @@
|
|
2437
2716
|
|
2438
2717
|
|
2439
2718
|
—
|
2440
|
-
<div class='inline'>
|
2441
|
-
|
2719
|
+
<div class='inline'><p>If true, filter for pinned
|
2720
|
+
statuses</p>
|
2442
2721
|
</div>
|
2443
2722
|
|
2444
2723
|
</li>
|
@@ -2455,8 +2734,8 @@
|
|
2455
2734
|
|
2456
2735
|
|
2457
2736
|
—
|
2458
|
-
<div class='inline'>
|
2459
|
-
|
2737
|
+
<div class='inline'><p>Filter for statuses containing the
|
2738
|
+
given tag</p>
|
2460
2739
|
</div>
|
2461
2740
|
|
2462
2741
|
</li>
|
@@ -2474,8 +2753,7 @@
|
|
2474
2753
|
|
2475
2754
|
|
2476
2755
|
—
|
2477
|
-
<div class='inline'>
|
2478
|
-
<p>Optional; applied to each item</p>
|
2756
|
+
<div class='inline'><p>Optional; applied to each item</p>
|
2479
2757
|
</div>
|
2480
2758
|
|
2481
2759
|
</li>
|
@@ -2507,8 +2785,7 @@
|
|
2507
2785
|
|
2508
2786
|
|
2509
2787
|
—
|
2510
|
-
<div class='inline'>
|
2511
|
-
<p>if block is not given, otherwise self</p>
|
2788
|
+
<div class='inline'><p>if block is not given, otherwise self</p>
|
2512
2789
|
</div>
|
2513
2790
|
|
2514
2791
|
</li>
|
@@ -2528,23 +2805,25 @@
|
|
2528
2805
|
<pre class="lines">
|
2529
2806
|
|
2530
2807
|
|
2531
|
-
|
2532
|
-
|
2533
|
-
|
2534
|
-
|
2535
|
-
|
2536
|
-
|
2537
|
-
|
2538
|
-
|
2539
|
-
|
2540
|
-
|
2541
|
-
|
2808
|
+
422
|
2809
|
+
423
|
2810
|
+
424
|
2811
|
+
425
|
2812
|
+
426
|
2813
|
+
427
|
2814
|
+
428
|
2815
|
+
429
|
2816
|
+
430
|
2817
|
+
431
|
2818
|
+
432
|
2819
|
+
433</pre>
|
2542
2820
|
</td>
|
2543
2821
|
<td>
|
2544
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
2822
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 422</span>
|
2545
2823
|
|
2546
2824
|
<span class='kw'>def</span> <span class='id identifier rubyid_each_status'>each_status</span><span class='lparen'>(</span><span class='id identifier rubyid_account_id'>account_id</span><span class='comma'>,</span>
|
2547
2825
|
<span class='label'>limit:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
2826
|
+
<span class='label'>max_id:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
2548
2827
|
<span class='label'>only_media:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
2549
2828
|
<span class='label'>exclude_replies:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
2550
2829
|
<span class='label'>exclude_reblogs:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
@@ -2562,7 +2841,7 @@
|
|
2562
2841
|
<div class="method_details ">
|
2563
2842
|
<h3 class="signature " id="each_tag_status-instance_method">
|
2564
2843
|
|
2565
|
-
#<strong>each_tag_status</strong>(hashtag_s, limit: nil, local: false, remote: false, only_media: false, all: [], none: []) {|item| ... } ⇒ <tt>Enumerator</tt>
|
2844
|
+
#<strong>each_tag_status</strong>(hashtag_s, limit: nil, max_id: "", local: false, remote: false, only_media: false, all: [], none: []) {|item| ... } ⇒ <tt>Enumerator</tt>
|
2566
2845
|
|
2567
2846
|
|
2568
2847
|
|
@@ -2570,10 +2849,12 @@
|
|
2570
2849
|
|
2571
2850
|
</h3><div class="docstring">
|
2572
2851
|
<div class="discussion">
|
2573
|
-
|
2574
|
-
<p>Retrieve a tag’s timeline.</p>
|
2852
|
+
<p>Retrieve a tag's timeline.</p>
|
2575
2853
|
|
2576
|
-
<p>The tag may either be a String (containing one hashtag) or an
|
2854
|
+
<p>The tag may either be a String (containing one hashtag) or an
|
2855
|
+
Array containing one or more. If more than one hashtag is
|
2856
|
+
given, all statuses containing <strong>any</strong> of the given hashtags are
|
2857
|
+
retrieved. (This uses the <code>any[]</code> parameter in the API.)</p>
|
2577
2858
|
|
2578
2859
|
<p>There is currently no check for contradictory tag lists.</p>
|
2579
2860
|
|
@@ -2594,8 +2875,7 @@
|
|
2594
2875
|
|
2595
2876
|
|
2596
2877
|
—
|
2597
|
-
<div class='inline'>
|
2598
|
-
<p>Hashtag(s) to retrieve.</p>
|
2878
|
+
<div class='inline'><p>Hashtag(s) to retrieve.</p>
|
2599
2879
|
</div>
|
2600
2880
|
|
2601
2881
|
</li>
|
@@ -2612,8 +2892,24 @@
|
|
2612
2892
|
|
2613
2893
|
|
2614
2894
|
—
|
2615
|
-
<div class='inline'>
|
2616
|
-
|
2895
|
+
<div class='inline'><p>maximum number of items to retrieve</p>
|
2896
|
+
</div>
|
2897
|
+
|
2898
|
+
</li>
|
2899
|
+
|
2900
|
+
<li>
|
2901
|
+
|
2902
|
+
<span class='name'>max_id</span>
|
2903
|
+
|
2904
|
+
|
2905
|
+
<span class='type'>(<tt>String</tt>)</span>
|
2906
|
+
|
2907
|
+
|
2908
|
+
<em class="default">(defaults to: <tt>""</tt>)</em>
|
2909
|
+
|
2910
|
+
|
2911
|
+
—
|
2912
|
+
<div class='inline'><p>return results older than this ID.</p>
|
2617
2913
|
</div>
|
2618
2914
|
|
2619
2915
|
</li>
|
@@ -2630,8 +2926,7 @@
|
|
2630
2926
|
|
2631
2927
|
|
2632
2928
|
—
|
2633
|
-
<div class='inline'>
|
2634
|
-
<p>retrieve only local statuses</p>
|
2929
|
+
<div class='inline'><p>retrieve only local statuses</p>
|
2635
2930
|
</div>
|
2636
2931
|
|
2637
2932
|
</li>
|
@@ -2648,8 +2943,7 @@
|
|
2648
2943
|
|
2649
2944
|
|
2650
2945
|
—
|
2651
|
-
<div class='inline'>
|
2652
|
-
<p>retrieve only remote statuses</p>
|
2946
|
+
<div class='inline'><p>retrieve only remote statuses</p>
|
2653
2947
|
</div>
|
2654
2948
|
|
2655
2949
|
</li>
|
@@ -2666,8 +2960,7 @@
|
|
2666
2960
|
|
2667
2961
|
|
2668
2962
|
—
|
2669
|
-
<div class='inline'>
|
2670
|
-
<p>retrieve only media status</p>
|
2963
|
+
<div class='inline'><p>retrieve only media status</p>
|
2671
2964
|
</div>
|
2672
2965
|
|
2673
2966
|
</li>
|
@@ -2684,8 +2977,8 @@
|
|
2684
2977
|
|
2685
2978
|
|
2686
2979
|
—
|
2687
|
-
<div class='inline'>
|
2688
|
-
|
2980
|
+
<div class='inline'><p>list of other tags that
|
2981
|
+
must also be present.</p>
|
2689
2982
|
</div>
|
2690
2983
|
|
2691
2984
|
</li>
|
@@ -2702,8 +2995,7 @@
|
|
2702
2995
|
|
2703
2996
|
|
2704
2997
|
—
|
2705
|
-
<div class='inline'>
|
2706
|
-
<p>list of tags that are excluded.</p>
|
2998
|
+
<div class='inline'><p>list of tags that are excluded.</p>
|
2707
2999
|
</div>
|
2708
3000
|
|
2709
3001
|
</li>
|
@@ -2721,8 +3013,7 @@
|
|
2721
3013
|
|
2722
3014
|
|
2723
3015
|
—
|
2724
|
-
<div class='inline'>
|
2725
|
-
<p>block to apply to each Status; optional</p>
|
3016
|
+
<div class='inline'><p>block to apply to each Status; optional</p>
|
2726
3017
|
</div>
|
2727
3018
|
|
2728
3019
|
</li>
|
@@ -2754,8 +3045,7 @@
|
|
2754
3045
|
|
2755
3046
|
|
2756
3047
|
—
|
2757
|
-
<div class='inline'>
|
2758
|
-
<p>if block is not given, otherwise self</p>
|
3048
|
+
<div class='inline'><p>if block is not given, otherwise self</p>
|
2759
3049
|
</div>
|
2760
3050
|
|
2761
3051
|
</li>
|
@@ -2775,38 +3065,40 @@
|
|
2775
3065
|
<pre class="lines">
|
2776
3066
|
|
2777
3067
|
|
2778
|
-
|
2779
|
-
|
2780
|
-
|
2781
|
-
|
2782
|
-
|
2783
|
-
|
2784
|
-
|
2785
|
-
|
2786
|
-
|
2787
|
-
|
2788
|
-
|
2789
|
-
|
2790
|
-
|
2791
|
-
|
2792
|
-
|
2793
|
-
|
2794
|
-
|
2795
|
-
|
2796
|
-
|
2797
|
-
|
2798
|
-
|
2799
|
-
|
2800
|
-
|
2801
|
-
|
2802
|
-
|
2803
|
-
|
3068
|
+
499
|
3069
|
+
500
|
3070
|
+
501
|
3071
|
+
502
|
3072
|
+
503
|
3073
|
+
504
|
3074
|
+
505
|
3075
|
+
506
|
3076
|
+
507
|
3077
|
+
508
|
3078
|
+
509
|
3079
|
+
510
|
3080
|
+
511
|
3081
|
+
512
|
3082
|
+
513
|
3083
|
+
514
|
3084
|
+
515
|
3085
|
+
516
|
3086
|
+
517
|
3087
|
+
518
|
3088
|
+
519
|
3089
|
+
520
|
3090
|
+
521
|
3091
|
+
522
|
3092
|
+
523
|
3093
|
+
524
|
3094
|
+
525</pre>
|
2804
3095
|
</td>
|
2805
3096
|
<td>
|
2806
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
3097
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 499</span>
|
2807
3098
|
|
2808
3099
|
<span class='kw'>def</span> <span class='id identifier rubyid_each_tag_status'>each_tag_status</span><span class='lparen'>(</span><span class='id identifier rubyid_hashtag_s'>hashtag_s</span><span class='comma'>,</span>
|
2809
3100
|
<span class='label'>limit:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
3101
|
+
<span class='label'>max_id:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
2810
3102
|
<span class='label'>local:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
2811
3103
|
<span class='label'>remote:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
2812
3104
|
<span class='label'>only_media:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
@@ -2847,12 +3139,17 @@
|
|
2847
3139
|
|
2848
3140
|
</h3><div class="docstring">
|
2849
3141
|
<div class="discussion">
|
2850
|
-
|
2851
|
-
<p>Update the status with the given Id.</p>
|
3142
|
+
<p>Update the status with the given Id.</p>
|
2852
3143
|
|
2853
|
-
<p>Requires token with sufficient permission for the account that
|
3144
|
+
<p>Requires token with sufficient permission for the account that
|
3145
|
+
owns the status.</p>
|
2854
3146
|
|
2855
|
-
<p>Notionally, this method will change <em>all</em> of the affected status
|
3147
|
+
<p>Notionally, this method will change <em>all</em> of the affected status
|
3148
|
+
parts each time it's invoked, passing the default parameter if
|
3149
|
+
none is given. This is because it is unclear how the API
|
3150
|
+
handles omitted fields so we just don't do that. (You can force
|
3151
|
+
it to omit an argument by setting it to nil; this may or may not
|
3152
|
+
work for you.)</p>
|
2856
3153
|
|
2857
3154
|
|
2858
3155
|
</div>
|
@@ -2871,8 +3168,7 @@
|
|
2871
3168
|
|
2872
3169
|
|
2873
3170
|
—
|
2874
|
-
<div class='inline'>
|
2875
|
-
<p>id of the status to edit</p>
|
3171
|
+
<div class='inline'><p>id of the status to edit</p>
|
2876
3172
|
</div>
|
2877
3173
|
|
2878
3174
|
</li>
|
@@ -2887,8 +3183,7 @@
|
|
2887
3183
|
|
2888
3184
|
|
2889
3185
|
—
|
2890
|
-
<div class='inline'>
|
2891
|
-
<p>new status text</p>
|
3186
|
+
<div class='inline'><p>new status text</p>
|
2892
3187
|
</div>
|
2893
3188
|
|
2894
3189
|
</li>
|
@@ -2905,8 +3200,8 @@
|
|
2905
3200
|
|
2906
3201
|
|
2907
3202
|
—
|
2908
|
-
<div class='inline'>
|
2909
|
-
|
3203
|
+
<div class='inline'><p>array of media object IDs
|
3204
|
+
to attach to this status.</p>
|
2910
3205
|
</div>
|
2911
3206
|
|
2912
3207
|
</li>
|
@@ -2923,8 +3218,9 @@
|
|
2923
3218
|
|
2924
3219
|
|
2925
3220
|
—
|
2926
|
-
<div class='inline'>
|
2927
|
-
|
3221
|
+
<div class='inline'><p>Sets or clears the content
|
3222
|
+
warning. Non-empty value also
|
3223
|
+
sets the <code>sensitive</code> field.</p>
|
2928
3224
|
</div>
|
2929
3225
|
|
2930
3226
|
</li>
|
@@ -2941,8 +3237,10 @@
|
|
2941
3237
|
|
2942
3238
|
|
2943
3239
|
—
|
2944
|
-
<div class='inline'>
|
2945
|
-
|
3240
|
+
<div class='inline'><p>The language of the status;
|
3241
|
+
defaults to "en". (Apologies for
|
3242
|
+
the anglocentrism; this should be
|
3243
|
+
consistent.)</p>
|
2946
3244
|
</div>
|
2947
3245
|
|
2948
3246
|
</li>
|
@@ -2960,8 +3258,7 @@
|
|
2960
3258
|
|
2961
3259
|
|
2962
3260
|
—
|
2963
|
-
<div class='inline'>
|
2964
|
-
<p>the updated status</p>
|
3261
|
+
<div class='inline'><p>the updated status</p>
|
2965
3262
|
</div>
|
2966
3263
|
|
2967
3264
|
</li>
|
@@ -2981,21 +3278,21 @@
|
|
2981
3278
|
<pre class="lines">
|
2982
3279
|
|
2983
3280
|
|
2984
|
-
|
2985
|
-
|
2986
|
-
|
2987
|
-
|
2988
|
-
|
2989
|
-
|
2990
|
-
|
2991
|
-
|
2992
|
-
|
2993
|
-
|
2994
|
-
|
2995
|
-
|
3281
|
+
739
|
3282
|
+
740
|
3283
|
+
741
|
3284
|
+
742
|
3285
|
+
743
|
3286
|
+
744
|
3287
|
+
745
|
3288
|
+
746
|
3289
|
+
747
|
3290
|
+
748
|
3291
|
+
749
|
3292
|
+
750</pre>
|
2996
3293
|
</td>
|
2997
3294
|
<td>
|
2998
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
3295
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 739</span>
|
2999
3296
|
|
3000
3297
|
<span class='kw'>def</span> <span class='id identifier rubyid_edit_status'>edit_status</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_status'>status</span><span class='comma'>,</span>
|
3001
3298
|
<span class='label'>media_ids:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
@@ -3025,8 +3322,7 @@
|
|
3025
3322
|
|
3026
3323
|
</h3><div class="docstring">
|
3027
3324
|
<div class="discussion">
|
3028
|
-
|
3029
|
-
<p>Fetch user details by ID</p>
|
3325
|
+
<p>Fetch user details by ID</p>
|
3030
3326
|
|
3031
3327
|
|
3032
3328
|
</div>
|
@@ -3045,8 +3341,7 @@
|
|
3045
3341
|
|
3046
3342
|
|
3047
3343
|
—
|
3048
|
-
<div class='inline'>
|
3049
|
-
<p>the ID code of the account</p>
|
3344
|
+
<div class='inline'><p>the ID code of the account</p>
|
3050
3345
|
</div>
|
3051
3346
|
|
3052
3347
|
</li>
|
@@ -3080,12 +3375,12 @@
|
|
3080
3375
|
<pre class="lines">
|
3081
3376
|
|
3082
3377
|
|
3083
|
-
|
3084
|
-
|
3085
|
-
|
3378
|
+
238
|
3379
|
+
239
|
3380
|
+
240</pre>
|
3086
3381
|
</td>
|
3087
3382
|
<td>
|
3088
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
3383
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 238</span>
|
3089
3384
|
|
3090
3385
|
<span class='kw'>def</span> <span class='id identifier rubyid_fetch_account'>fetch_account</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
3091
3386
|
<span class='kw'>return</span> <span class='id identifier rubyid_rest_get'>rest_get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>accounts/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="Entity.html" title="Shep::Entity (class)">Entity</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Entity/Account.html" title="Shep::Entity::Account (class)">Account</a></span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
@@ -3098,7 +3393,7 @@
|
|
3098
3393
|
<div class="method_details ">
|
3099
3394
|
<h3 class="signature " id="fetch_account_by_username-instance_method">
|
3100
3395
|
|
3101
|
-
#<strong>fetch_account_by_username</strong>(handle) ⇒ <tt><span class='object_link'><a href="Entity/Account.html" title="Shep::Entity::Account (class)">Entity::Account</a></span></tt>
|
3396
|
+
#<strong>fetch_account_by_username</strong>(handle) ⇒ <tt><span class='object_link'><a href="Entity/Account.html" title="Shep::Entity::Account (class)">Entity::Account</a></span></tt><sup>?</sup>
|
3102
3397
|
|
3103
3398
|
|
3104
3399
|
|
@@ -3106,8 +3401,7 @@
|
|
3106
3401
|
|
3107
3402
|
</h3><div class="docstring">
|
3108
3403
|
<div class="discussion">
|
3109
|
-
|
3110
|
-
<p>Fetch user details by username.</p>
|
3404
|
+
<p>Fetch user details by username.</p>
|
3111
3405
|
|
3112
3406
|
<p>The username must belong to a user on the current server.</p>
|
3113
3407
|
|
@@ -3128,8 +3422,8 @@
|
|
3128
3422
|
|
3129
3423
|
|
3130
3424
|
—
|
3131
|
-
<div class='inline'>
|
3132
|
-
|
3425
|
+
<div class='inline'><p>the account's username with or without the
|
3426
|
+
leading '@' character (e.g. @benoitmandelbot)</p>
|
3133
3427
|
</div>
|
3134
3428
|
|
3135
3429
|
</li>
|
@@ -3142,9 +3436,13 @@
|
|
3142
3436
|
<li>
|
3143
3437
|
|
3144
3438
|
|
3145
|
-
<span class='type'>(<tt><span class='object_link'><a href="Entity/Account.html" title="Shep::Entity::Account (class)">Entity::Account</a></span></tt>)</span>
|
3439
|
+
<span class='type'>(<tt><span class='object_link'><a href="Entity/Account.html" title="Shep::Entity::Account (class)">Entity::Account</a></span></tt>, <tt>nil</tt>)</span>
|
3440
|
+
|
3146
3441
|
|
3147
3442
|
|
3443
|
+
—
|
3444
|
+
<div class='inline'><p>The Account or nil if it can't be found.</p>
|
3445
|
+
</div>
|
3148
3446
|
|
3149
3447
|
</li>
|
3150
3448
|
|
@@ -3163,15 +3461,23 @@
|
|
3163
3461
|
<pre class="lines">
|
3164
3462
|
|
3165
3463
|
|
3166
|
-
|
3167
|
-
|
3168
|
-
|
3464
|
+
253
|
3465
|
+
254
|
3466
|
+
255
|
3467
|
+
256
|
3468
|
+
257
|
3469
|
+
258
|
3470
|
+
259</pre>
|
3169
3471
|
</td>
|
3170
3472
|
<td>
|
3171
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
3473
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 253</span>
|
3172
3474
|
|
3173
3475
|
<span class='kw'>def</span> <span class='id identifier rubyid_fetch_account_by_username'>fetch_account_by_username</span><span class='lparen'>(</span><span class='id identifier rubyid_handle'>handle</span><span class='rparen'>)</span>
|
3174
3476
|
<span class='kw'>return</span> <span class='id identifier rubyid_rest_get'>rest_get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>accounts/lookup</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="Entity.html" title="Shep::Entity (class)">Entity</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Entity/Account.html" title="Shep::Entity::Account (class)">Account</a></span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>acct:</span> <span class='id identifier rubyid_handle'>handle</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
3477
|
+
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="Error.html" title="Shep::Error (class)">Error</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error/Http.html" title="Shep::Error::Http (class)">Http</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_oopsie'>oopsie</span>
|
3478
|
+
<span class='comment'># As a special case, return nil if the lookup fails
|
3479
|
+
</span> <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='id identifier rubyid_oopsie'>oopsie</span><span class='period'>.</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Net</span><span class='op'>::</span><span class='const'>HTTPNotFound</span><span class='rparen'>)</span>
|
3480
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='id identifier rubyid_oopsie'>oopsie</span>
|
3175
3481
|
<span class='kw'>end</span></pre>
|
3176
3482
|
</td>
|
3177
3483
|
</tr>
|
@@ -3189,8 +3495,7 @@
|
|
3189
3495
|
|
3190
3496
|
</h3><div class="docstring">
|
3191
3497
|
<div class="discussion">
|
3192
|
-
|
3193
|
-
<p>Fetch the context (parent and child status) of status at ‘id’</p>
|
3498
|
+
<p>Fetch the context (parent and child status) of status at 'id'</p>
|
3194
3499
|
|
3195
3500
|
|
3196
3501
|
</div>
|
@@ -3224,10 +3529,10 @@
|
|
3224
3529
|
<pre class="lines">
|
3225
3530
|
|
3226
3531
|
|
3227
|
-
|
3532
|
+
285</pre>
|
3228
3533
|
</td>
|
3229
3534
|
<td>
|
3230
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
3535
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 285</span>
|
3231
3536
|
|
3232
3537
|
<span class='kw'>def</span> <span class='id identifier rubyid_fetch_context'>fetch_context</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='id identifier rubyid_rest_get'>rest_get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>statuses/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/context</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="Entity.html" title="Shep::Entity (class)">Entity</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Entity/Context.html" title="Shep::Entity::Context (class)">Context</a></span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span></pre>
|
3233
3538
|
</td>
|
@@ -3246,8 +3551,7 @@
|
|
3246
3551
|
|
3247
3552
|
</h3><div class="docstring">
|
3248
3553
|
<div class="discussion">
|
3249
|
-
|
3250
|
-
<p>Fetch an individual notification by ID.</p>
|
3554
|
+
<p>Fetch an individual notification by ID.</p>
|
3251
3555
|
|
3252
3556
|
<p>Requires a token with sufficient permissions.</p>
|
3253
3557
|
|
@@ -3268,8 +3572,7 @@
|
|
3268
3572
|
|
3269
3573
|
|
3270
3574
|
—
|
3271
|
-
<div class='inline'>
|
3272
|
-
<p>the notification ID</p>
|
3575
|
+
<div class='inline'><p>the notification ID</p>
|
3273
3576
|
</div>
|
3274
3577
|
|
3275
3578
|
</li>
|
@@ -3303,11 +3606,11 @@
|
|
3303
3606
|
<pre class="lines">
|
3304
3607
|
|
3305
3608
|
|
3306
|
-
|
3307
|
-
|
3609
|
+
270
|
3610
|
+
271</pre>
|
3308
3611
|
</td>
|
3309
3612
|
<td>
|
3310
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
3613
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 270</span>
|
3311
3614
|
|
3312
3615
|
<span class='kw'>def</span> <span class='id identifier rubyid_fetch_notification'>fetch_notification</span><span class='lparen'>(</span><span class='id identifier rubyid_ntfn_id'>ntfn_id</span><span class='rparen'>)</span> <span class='op'>=</span>
|
3313
3616
|
<span class='id identifier rubyid_rest_get'>rest_get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>notifications/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ntfn_id'>ntfn_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="Entity.html" title="Shep::Entity (class)">Entity</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Entity/Notification.html" title="Shep::Entity::Notification (class)">Notification</a></span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span></pre>
|
@@ -3327,8 +3630,7 @@
|
|
3327
3630
|
|
3328
3631
|
</h3><div class="docstring">
|
3329
3632
|
<div class="discussion">
|
3330
|
-
|
3331
|
-
<p>Fetch a single status</p>
|
3633
|
+
<p>Fetch a single status</p>
|
3332
3634
|
|
3333
3635
|
|
3334
3636
|
</div>
|
@@ -3362,10 +3664,10 @@
|
|
3362
3664
|
<pre class="lines">
|
3363
3665
|
|
3364
3666
|
|
3365
|
-
|
3667
|
+
278</pre>
|
3366
3668
|
</td>
|
3367
3669
|
<td>
|
3368
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
3670
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 278</span>
|
3369
3671
|
|
3370
3672
|
<span class='kw'>def</span> <span class='id identifier rubyid_fetch_status'>fetch_status</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='id identifier rubyid_rest_get'>rest_get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>statuses/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="Entity.html" title="Shep::Entity (class)">Entity</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Entity/Status.html" title="Shep::Entity::Status (class)">Status</a></span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span></pre>
|
3371
3673
|
</td>
|
@@ -3384,8 +3686,7 @@
|
|
3384
3686
|
|
3385
3687
|
</h3><div class="docstring">
|
3386
3688
|
<div class="discussion">
|
3387
|
-
|
3388
|
-
<p>Fetch the editable source of status at id.</p>
|
3689
|
+
<p>Fetch the editable source of status at id.</p>
|
3389
3690
|
|
3390
3691
|
<p>Requires token.</p>
|
3391
3692
|
|
@@ -3421,11 +3722,11 @@
|
|
3421
3722
|
<pre class="lines">
|
3422
3723
|
|
3423
3724
|
|
3424
|
-
|
3425
|
-
|
3725
|
+
294
|
3726
|
+
295</pre>
|
3426
3727
|
</td>
|
3427
3728
|
<td>
|
3428
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
3729
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 294</span>
|
3429
3730
|
|
3430
3731
|
<span class='kw'>def</span> <span class='id identifier rubyid_fetch_status_src'>fetch_status_src</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='id identifier rubyid_rest_get'>rest_get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>statuses/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/source</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
3431
3732
|
<span class='const'><span class='object_link'><a href="Entity.html" title="Shep::Entity (class)">Entity</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Entity/StatusSource.html" title="Shep::Entity::StatusSource (class)">StatusSource</a></span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span></pre>
|
@@ -3445,14 +3746,22 @@
|
|
3445
3746
|
|
3446
3747
|
</h3><div class="docstring">
|
3447
3748
|
<div class="discussion">
|
3448
|
-
|
3449
|
-
<p>Fetch the given status and also any attached media.</p>
|
3749
|
+
<p>Fetch the given status and also any attached media.</p>
|
3450
3750
|
|
3451
|
-
<p>Media is downloaded into the given directory unless a file with
|
3751
|
+
<p>Media is downloaded into the given directory unless a file with
|
3752
|
+
the expected name is already there (and <code>refetch</code> is not
|
3753
|
+
<code>true</code>).</p>
|
3452
3754
|
|
3453
|
-
<p>Filenames are chosen by the function; the second return value (a
|
3755
|
+
<p>Filenames are chosen by the function; the second return value (a
|
3756
|
+
<code>Hash</code>) can be used to find them. Value order also corresponds
|
3757
|
+
to the order of the returned <code>Status</code>'s <code>media_attachments</code>
|
3758
|
+
field.</p>
|
3454
3759
|
|
3455
|
-
<p>Note that intermediate files unique temporary names while
|
3760
|
+
<p>Note that intermediate files unique temporary names while
|
3761
|
+
downloading is in progress. This means it is safe to set
|
3762
|
+
<code>refetch</code> to false even if a previous download attempt failed.
|
3763
|
+
However, it is would be necessary to delete the intermediate
|
3764
|
+
file, which has the suffic ".tmp".</p>
|
3456
3765
|
|
3457
3766
|
|
3458
3767
|
</div>
|
@@ -3471,8 +3780,7 @@
|
|
3471
3780
|
|
3472
3781
|
|
3473
3782
|
—
|
3474
|
-
<div class='inline'>
|
3475
|
-
<p>ID of the status to retrieve</p>
|
3783
|
+
<div class='inline'><p>ID of the status to retrieve</p>
|
3476
3784
|
</div>
|
3477
3785
|
|
3478
3786
|
</li>
|
@@ -3489,8 +3797,7 @@
|
|
3489
3797
|
|
3490
3798
|
|
3491
3799
|
—
|
3492
|
-
<div class='inline'>
|
3493
|
-
<p>Path to the download directory</p>
|
3800
|
+
<div class='inline'><p>Path to the download directory</p>
|
3494
3801
|
</div>
|
3495
3802
|
|
3496
3803
|
</li>
|
@@ -3507,8 +3814,8 @@
|
|
3507
3814
|
|
3508
3815
|
|
3509
3816
|
—
|
3510
|
-
<div class='inline'>
|
3511
|
-
|
3817
|
+
<div class='inline'><p>Fetch the media even if it is already
|
3818
|
+
present</p>
|
3512
3819
|
</div>
|
3513
3820
|
|
3514
3821
|
</li>
|
@@ -3526,8 +3833,8 @@
|
|
3526
3833
|
|
3527
3834
|
|
3528
3835
|
—
|
3529
|
-
<div class='inline'>
|
3530
|
-
|
3836
|
+
<div class='inline'><p>the Status and a Hash mapping the media
|
3837
|
+
URL to the corresponding local file.</p>
|
3531
3838
|
</div>
|
3532
3839
|
|
3533
3840
|
</li>
|
@@ -3547,34 +3854,34 @@
|
|
3547
3854
|
<pre class="lines">
|
3548
3855
|
|
3549
3856
|
|
3550
|
-
|
3551
|
-
|
3552
|
-
|
3553
|
-
|
3554
|
-
|
3555
|
-
|
3556
|
-
|
3557
|
-
|
3558
|
-
|
3559
|
-
|
3560
|
-
|
3561
|
-
|
3562
|
-
|
3563
|
-
|
3564
|
-
|
3565
|
-
|
3566
|
-
|
3567
|
-
|
3568
|
-
|
3569
|
-
|
3570
|
-
|
3571
|
-
|
3572
|
-
|
3573
|
-
|
3574
|
-
|
3857
|
+
325
|
3858
|
+
326
|
3859
|
+
327
|
3860
|
+
328
|
3861
|
+
329
|
3862
|
+
330
|
3863
|
+
331
|
3864
|
+
332
|
3865
|
+
333
|
3866
|
+
334
|
3867
|
+
335
|
3868
|
+
336
|
3869
|
+
337
|
3870
|
+
338
|
3871
|
+
339
|
3872
|
+
340
|
3873
|
+
341
|
3874
|
+
342
|
3875
|
+
343
|
3876
|
+
344
|
3877
|
+
345
|
3878
|
+
346
|
3879
|
+
347
|
3880
|
+
348
|
3881
|
+
349</pre>
|
3575
3882
|
</td>
|
3576
3883
|
<td>
|
3577
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
3884
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 325</span>
|
3578
3885
|
|
3579
3886
|
<span class='kw'>def</span> <span class='id identifier rubyid_fetch_status_with_media'>fetch_status_with_media</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_media_dir'>media_dir</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>refetch:</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
3580
3887
|
<span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_fetch_status'>fetch_status</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
@@ -3585,18 +3892,18 @@
|
|
3585
3892
|
|
3586
3893
|
<span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_refetch'>refetch</span> <span class='op'>&&</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exist?'>exist?</span><span class='lparen'>(</span><span class='id identifier rubyid_outfile'>outfile</span><span class='rparen'>)</span>
|
3587
3894
|
<span class='ivar'>@logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Found '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_outfile'>outfile</span><span class='embexpr_end'>}</span><span class='tstring_content'>'; skipping.</span><span class='tstring_end'>"</span></span>
|
3588
|
-
<span class='id identifier rubyid_success'>success</span> <span class='op'>=</span> <span class='kw'>true</span>
|
3589
3895
|
<span class='kw'>else</span>
|
3590
3896
|
<span class='id identifier rubyid_tmp'>tmp</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='id identifier rubyid_media_dir'>media_dir</span><span class='comma'>,</span> <span class='const'>SecureRandom</span><span class='period'>.</span><span class='id identifier rubyid_uuid'>uuid</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.tmp</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
3591
|
-
<span class='
|
3592
|
-
|
3897
|
+
<span class='kw'>begin</span>
|
3898
|
+
<span class='id identifier rubyid_basic_get_binary'>basic_get_binary</span><span class='lparen'>(</span><span class='id identifier rubyid_ma'>ma</span><span class='period'>.</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_tmp'>tmp</span><span class='rparen'>)</span>
|
3593
3899
|
<span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_mv'>mv</span><span class='lparen'>(</span><span class='id identifier rubyid_tmp'>tmp</span><span class='comma'>,</span> <span class='id identifier rubyid_outfile'>outfile</span><span class='rparen'>)</span>
|
3594
|
-
<span class='kw'>
|
3900
|
+
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="Error.html" title="Shep::Error (class)">Error</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error/Http.html" title="Shep::Error::Http (class)">Http</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
3595
3901
|
<span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_rm'>rm</span><span class='lparen'>(</span><span class='id identifier rubyid_tmp'>tmp</span><span class='comma'>,</span> <span class='label'>force:</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
3902
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='id identifier rubyid_e'>e</span>
|
3596
3903
|
<span class='kw'>end</span>
|
3597
3904
|
<span class='kw'>end</span>
|
3598
3905
|
|
3599
|
-
<span class='id identifier rubyid_media'>media</span><span class='lbracket'>[</span><span class='id identifier rubyid_ma'>ma</span><span class='period'>.</span><span class='id identifier rubyid_url'>url</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier
|
3906
|
+
<span class='id identifier rubyid_media'>media</span><span class='lbracket'>[</span><span class='id identifier rubyid_ma'>ma</span><span class='period'>.</span><span class='id identifier rubyid_url'>url</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_outfile'>outfile</span>
|
3600
3907
|
<span class='rbrace'>}</span>
|
3601
3908
|
|
3602
3909
|
<span class='kw'>return</span> <span class='lbracket'>[</span><span class='id identifier rubyid_status'>status</span><span class='comma'>,</span> <span class='id identifier rubyid_media'>media</span><span class='rbracket'>]</span>
|
@@ -3609,7 +3916,7 @@
|
|
3609
3916
|
<div class="method_details ">
|
3610
3917
|
<h3 class="signature " id="post_status-instance_method">
|
3611
3918
|
|
3612
|
-
#<strong>post_status</strong>(text, visibility: :private, media_ids: [], spoiler_text: "", language: "") ⇒ <tt>
|
3919
|
+
#<strong>post_status</strong>(text, visibility: :private, media_ids: [], spoiler_text: "", language: "") ⇒ <tt><span class='object_link'><a href="Entity/Status.html" title="Shep::Entity::Status (class)">Entity::Status</a></span></tt>
|
3613
3920
|
|
3614
3921
|
|
3615
3922
|
|
@@ -3617,12 +3924,14 @@
|
|
3617
3924
|
|
3618
3925
|
</h3><div class="docstring">
|
3619
3926
|
<div class="discussion">
|
3620
|
-
|
3621
|
-
|
3927
|
+
<p>Post a status containing the given text at the specified
|
3928
|
+
visibility with zero or more media attachments.</p>
|
3622
3929
|
|
3623
|
-
<p>visibility can be one of
|
3930
|
+
<p>visibility can be one of 'public', 'private', 'unlisted' or
|
3931
|
+
'direct'; these can be strings of symbols)</p>
|
3624
3932
|
|
3625
|
-
<p>media_ids is an array containing the ID strings of any media
|
3933
|
+
<p>media_ids is an array containing the ID strings of any media
|
3934
|
+
that may need to be attached.</p>
|
3626
3935
|
|
3627
3936
|
|
3628
3937
|
</div>
|
@@ -3643,8 +3952,8 @@
|
|
3643
3952
|
|
3644
3953
|
|
3645
3954
|
—
|
3646
|
-
<div class='inline'>
|
3647
|
-
|
3955
|
+
<div class='inline'><p>Status visibility; one of :public,
|
3956
|
+
:public, :unlisted or :direct</p>
|
3648
3957
|
</div>
|
3649
3958
|
|
3650
3959
|
</li>
|
@@ -3661,8 +3970,7 @@
|
|
3661
3970
|
|
3662
3971
|
|
3663
3972
|
—
|
3664
|
-
<div class='inline'>
|
3665
|
-
<p>List of IDs of attached media items.</p>
|
3973
|
+
<div class='inline'><p>List of IDs of attached media items.</p>
|
3666
3974
|
</div>
|
3667
3975
|
|
3668
3976
|
</li>
|
@@ -3679,8 +3987,8 @@
|
|
3679
3987
|
|
3680
3988
|
|
3681
3989
|
—
|
3682
|
-
<div class='inline'>
|
3683
|
-
|
3990
|
+
<div class='inline'><p>Content warning if non-empty string.
|
3991
|
+
Also sets <code>sensitive</code> to true.</p>
|
3684
3992
|
</div>
|
3685
3993
|
|
3686
3994
|
</li>
|
@@ -3697,14 +4005,30 @@
|
|
3697
4005
|
|
3698
4006
|
|
3699
4007
|
—
|
3700
|
-
<div class='inline'>
|
3701
|
-
<p>ISO language code</p>
|
4008
|
+
<div class='inline'><p>ISO language code</p>
|
3702
4009
|
</div>
|
3703
4010
|
|
3704
4011
|
</li>
|
3705
4012
|
|
3706
4013
|
</ul>
|
3707
4014
|
|
4015
|
+
<p class="tag_title">Returns:</p>
|
4016
|
+
<ul class="return">
|
4017
|
+
|
4018
|
+
<li>
|
4019
|
+
|
4020
|
+
|
4021
|
+
<span class='type'>(<tt><span class='object_link'><a href="Entity/Status.html" title="Shep::Entity::Status (class)">Entity::Status</a></span></tt>)</span>
|
4022
|
+
|
4023
|
+
|
4024
|
+
|
4025
|
+
—
|
4026
|
+
<div class='inline'><p>The new status.</p>
|
4027
|
+
</div>
|
4028
|
+
|
4029
|
+
</li>
|
4030
|
+
|
4031
|
+
</ul>
|
3708
4032
|
<p class="tag_title">Raises:</p>
|
3709
4033
|
<ul class="raise">
|
3710
4034
|
|
@@ -3732,30 +4056,30 @@
|
|
3732
4056
|
<pre class="lines">
|
3733
4057
|
|
3734
4058
|
|
3735
|
-
|
3736
|
-
|
3737
|
-
|
3738
|
-
|
3739
|
-
|
3740
|
-
|
3741
|
-
|
3742
|
-
|
3743
|
-
|
3744
|
-
|
3745
|
-
|
3746
|
-
|
3747
|
-
|
3748
|
-
|
3749
|
-
|
3750
|
-
|
3751
|
-
|
3752
|
-
|
3753
|
-
|
3754
|
-
|
3755
|
-
|
4059
|
+
686
|
4060
|
+
687
|
4061
|
+
688
|
4062
|
+
689
|
4063
|
+
690
|
4064
|
+
691
|
4065
|
+
692
|
4066
|
+
693
|
4067
|
+
694
|
4068
|
+
695
|
4069
|
+
696
|
4070
|
+
697
|
4071
|
+
698
|
4072
|
+
699
|
4073
|
+
700
|
4074
|
+
701
|
4075
|
+
702
|
4076
|
+
703
|
4077
|
+
704
|
4078
|
+
705
|
4079
|
+
706</pre>
|
3756
4080
|
</td>
|
3757
4081
|
<td>
|
3758
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
4082
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 686</span>
|
3759
4083
|
|
3760
4084
|
<span class='kw'>def</span> <span class='id identifier rubyid_post_status'>post_status</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='comma'>,</span>
|
3761
4085
|
<span class='label'>visibility:</span> <span class='symbol'>:private</span><span class='comma'>,</span>
|
@@ -3794,19 +4118,24 @@
|
|
3794
4118
|
|
3795
4119
|
</h3><div class="docstring">
|
3796
4120
|
<div class="discussion">
|
3797
|
-
|
3798
|
-
<p>Return the rate limit information as of the last operation.</p>
|
4121
|
+
<p>Return the rate limit information from the last REST request.</p>
|
3799
4122
|
|
3800
4123
|
<p>The result is a Struct with the following fields:</p>
|
3801
|
-
<ul><li>
|
3802
|
-
<p>limit Integer - Number of allowed requests per time period</p>
|
3803
|
-
</li><li>
|
3804
|
-
<p>remaining Integer - Number of requests you have left</p>
|
3805
|
-
</li><li>
|
3806
|
-
<p>reset Time - Future time when the limit resets</p>
|
3807
|
-
</li></ul>
|
3808
4124
|
|
3809
|
-
<
|
4125
|
+
<ul>
|
4126
|
+
<li>limit Integer - Number of allowed requests per time period</li>
|
4127
|
+
<li>remaining Integer - Number of requests you have left</li>
|
4128
|
+
<li>reset Time - Future time when the limit resets</li>
|
4129
|
+
</ul>
|
4130
|
+
|
4131
|
+
<p>Note that different types of operations have different rate
|
4132
|
+
limits. For example, most endpoints can be called up to 300
|
4133
|
+
times within 5 minutes but no more than 30 media uploads are
|
4134
|
+
allowed within a 30 minute time period.</p>
|
4135
|
+
|
4136
|
+
<p>Note also that some Shep methods will perform multiple API
|
4137
|
+
requests; this is only ever the rate limit information from the
|
4138
|
+
latest of these.</p>
|
3810
4139
|
|
3811
4140
|
|
3812
4141
|
</div>
|
@@ -3840,10 +4169,10 @@
|
|
3840
4169
|
<pre class="lines">
|
3841
4170
|
|
3842
4171
|
|
3843
|
-
|
4172
|
+
200</pre>
|
3844
4173
|
</td>
|
3845
4174
|
<td>
|
3846
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
4175
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 200</span>
|
3847
4176
|
|
3848
4177
|
<span class='kw'>def</span> <span class='id identifier rubyid_rate_limit'>rate_limit</span> <span class='op'>=</span> <span class='ivar'>@rate_limit</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre>
|
3849
4178
|
</td>
|
@@ -3862,8 +4191,7 @@
|
|
3862
4191
|
|
3863
4192
|
</h3><div class="docstring">
|
3864
4193
|
<div class="discussion">
|
3865
|
-
|
3866
|
-
<p>Return a human-readable summary of the rate limit.</p>
|
4194
|
+
<p>Return a human-readable summary of the rate limit.</p>
|
3867
4195
|
|
3868
4196
|
<p>text</p>
|
3869
4197
|
|
@@ -3883,8 +4211,7 @@
|
|
3883
4211
|
|
3884
4212
|
|
3885
4213
|
—
|
3886
|
-
<div class='inline'>
|
3887
|
-
<p><code>rate_limit()</code>‘s result as nicely-formatted</p>
|
4214
|
+
<div class='inline'><p><code>rate_limit()</code>'s result as nicely-formatted</p>
|
3888
4215
|
</div>
|
3889
4216
|
|
3890
4217
|
</li>
|
@@ -3897,16 +4224,16 @@
|
|
3897
4224
|
<pre class="lines">
|
3898
4225
|
|
3899
4226
|
|
3900
|
-
|
3901
|
-
|
3902
|
-
|
3903
|
-
|
3904
|
-
|
3905
|
-
|
3906
|
-
|
4227
|
+
207
|
4228
|
+
208
|
4229
|
+
209
|
4230
|
+
210
|
4231
|
+
211
|
4232
|
+
212
|
4233
|
+
213</pre>
|
3907
4234
|
</td>
|
3908
4235
|
<td>
|
3909
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
4236
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 207</span>
|
3910
4237
|
|
3911
4238
|
<span class='kw'>def</span> <span class='id identifier rubyid_rate_limit_desc'>rate_limit_desc</span>
|
3912
4239
|
<span class='id identifier rubyid_rem'>rem</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='ivar'>@rate_limit</span><span class='period'>.</span><span class='id identifier rubyid_remaining'>remaining</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>?</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
@@ -3923,7 +4250,7 @@
|
|
3923
4250
|
<div class="method_details ">
|
3924
4251
|
<h3 class="signature " id="upload_media-instance_method">
|
3925
4252
|
|
3926
|
-
#<strong>upload_media</strong>(path, content_type: nil, description: nil, focus_x: nil, focus_y: nil) ⇒ <tt>
|
4253
|
+
#<strong>upload_media</strong>(path, content_type: nil, description: nil, focus_x: nil, focus_y: nil) ⇒ <tt><span class='object_link'><a href="Entity/MediaAttachment.html" title="Shep::Entity::MediaAttachment (class)">Entity::MediaAttachment</a></span></tt>
|
3927
4254
|
|
3928
4255
|
|
3929
4256
|
|
@@ -3931,14 +4258,139 @@
|
|
3931
4258
|
|
3932
4259
|
</h3><div class="docstring">
|
3933
4260
|
<div class="discussion">
|
3934
|
-
|
3935
|
-
|
4261
|
+
<p>Upload the media contained in the file at 'path'.</p>
|
4262
|
+
|
4263
|
+
<p>Requires token with sufficient permission for the account that
|
4264
|
+
owns the status.</p>
|
4265
|
+
|
4266
|
+
<p>Note that Mastodon processes attachments asynchronously, so the
|
4267
|
+
attachment may not be available for display when this method
|
4268
|
+
returns. Posting an unprocessed status as an attachment works
|
4269
|
+
as expected but it's unclear what happens between posting and
|
4270
|
+
when the processing task completes. Usually, this shouldn't
|
4271
|
+
matter to you.</p>
|
4272
|
+
|
4273
|
+
<p>If a rate limit is reached during a call to this method and
|
4274
|
+
<code>rate_limit_retry:</code> was set, the media file to upload should not
|
4275
|
+
be touched in any way until the method returns.</p>
|
3936
4276
|
|
3937
4277
|
|
3938
4278
|
</div>
|
3939
4279
|
</div>
|
3940
4280
|
<div class="tags">
|
4281
|
+
<p class="tag_title">Parameters:</p>
|
4282
|
+
<ul class="param">
|
4283
|
+
|
4284
|
+
<li>
|
4285
|
+
|
4286
|
+
<span class='name'>path</span>
|
4287
|
+
|
4288
|
+
|
4289
|
+
<span class='type'>(<tt>String</tt>)</span>
|
4290
|
+
|
4291
|
+
|
4292
|
+
|
4293
|
+
—
|
4294
|
+
<div class='inline'><p>Path to the media file.</p>
|
4295
|
+
</div>
|
4296
|
+
|
4297
|
+
</li>
|
4298
|
+
|
4299
|
+
<li>
|
4300
|
+
|
4301
|
+
<span class='name'>content_type</span>
|
4302
|
+
|
4303
|
+
|
4304
|
+
<span class='type'>(<tt>String</tt>)</span>
|
4305
|
+
|
4306
|
+
|
4307
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
4308
|
+
|
4309
|
+
|
4310
|
+
—
|
4311
|
+
<div class='inline'><p>MIME type of the media attachment.
|
4312
|
+
The default us usually all you need.</p>
|
4313
|
+
</div>
|
4314
|
+
|
4315
|
+
</li>
|
3941
4316
|
|
4317
|
+
<li>
|
4318
|
+
|
4319
|
+
<span class='name'>description</span>
|
4320
|
+
|
4321
|
+
|
4322
|
+
<span class='type'>(<tt>String</tt>)</span>
|
4323
|
+
|
4324
|
+
|
4325
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
4326
|
+
|
4327
|
+
|
4328
|
+
—
|
4329
|
+
<div class='inline'><p>The image description text.</p>
|
4330
|
+
</div>
|
4331
|
+
|
4332
|
+
</li>
|
4333
|
+
|
4334
|
+
<li>
|
4335
|
+
|
4336
|
+
<span class='name'>focus_x</span>
|
4337
|
+
|
4338
|
+
|
4339
|
+
<span class='type'>(<tt>Float</tt>)</span>
|
4340
|
+
|
4341
|
+
|
4342
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
4343
|
+
|
4344
|
+
|
4345
|
+
—
|
4346
|
+
<div class='inline'><p>The horizontal coordinate of
|
4347
|
+
the focus on a range of -1.0
|
4348
|
+
to 1.0. This is the point in
|
4349
|
+
the image that will be the
|
4350
|
+
center of the thumbnail. If
|
4351
|
+
set, <code>focus_y:</code> must also be
|
4352
|
+
set to a valid coordinate.</p>
|
4353
|
+
</div>
|
4354
|
+
|
4355
|
+
</li>
|
4356
|
+
|
4357
|
+
<li>
|
4358
|
+
|
4359
|
+
<span class='name'>focus_y</span>
|
4360
|
+
|
4361
|
+
|
4362
|
+
<span class='type'>(<tt>Float</tt>)</span>
|
4363
|
+
|
4364
|
+
|
4365
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
4366
|
+
|
4367
|
+
|
4368
|
+
—
|
4369
|
+
<div class='inline'><p>The vertical coordinate of the focus.</p>
|
4370
|
+
</div>
|
4371
|
+
|
4372
|
+
</li>
|
4373
|
+
|
4374
|
+
</ul>
|
4375
|
+
|
4376
|
+
<p class="tag_title">Returns:</p>
|
4377
|
+
<ul class="return">
|
4378
|
+
|
4379
|
+
<li>
|
4380
|
+
|
4381
|
+
|
4382
|
+
<span class='type'>(<tt><span class='object_link'><a href="Entity/MediaAttachment.html" title="Shep::Entity::MediaAttachment (class)">Entity::MediaAttachment</a></span></tt>)</span>
|
4383
|
+
|
4384
|
+
|
4385
|
+
|
4386
|
+
—
|
4387
|
+
<div class='inline'><p>The resulting MediaAttachment
|
4388
|
+
object but without the URL.</p>
|
4389
|
+
</div>
|
4390
|
+
|
4391
|
+
</li>
|
4392
|
+
|
4393
|
+
</ul>
|
3942
4394
|
|
3943
4395
|
<p class="tag_title">See Also:</p>
|
3944
4396
|
<ul class="see">
|
@@ -3953,36 +4405,36 @@
|
|
3953
4405
|
<pre class="lines">
|
3954
4406
|
|
3955
4407
|
|
3956
|
-
|
3957
|
-
|
3958
|
-
|
3959
|
-
|
3960
|
-
|
3961
|
-
|
3962
|
-
|
3963
|
-
|
3964
|
-
|
3965
|
-
|
3966
|
-
|
3967
|
-
|
3968
|
-
|
3969
|
-
|
3970
|
-
|
3971
|
-
|
3972
|
-
|
3973
|
-
|
3974
|
-
|
3975
|
-
|
3976
|
-
|
3977
|
-
|
3978
|
-
|
3979
|
-
|
3980
|
-
|
3981
|
-
|
3982
|
-
|
4408
|
+
790
|
4409
|
+
791
|
4410
|
+
792
|
4411
|
+
793
|
4412
|
+
794
|
4413
|
+
795
|
4414
|
+
796
|
4415
|
+
797
|
4416
|
+
798
|
4417
|
+
799
|
4418
|
+
800
|
4419
|
+
801
|
4420
|
+
802
|
4421
|
+
803
|
4422
|
+
804
|
4423
|
+
805
|
4424
|
+
806
|
4425
|
+
807
|
4426
|
+
808
|
4427
|
+
809
|
4428
|
+
810
|
4429
|
+
811
|
4430
|
+
812
|
4431
|
+
813
|
4432
|
+
814
|
4433
|
+
815
|
4434
|
+
816</pre>
|
3983
4435
|
</td>
|
3984
4436
|
<td>
|
3985
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
4437
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 790</span>
|
3986
4438
|
|
3987
4439
|
<span class='kw'>def</span> <span class='id identifier rubyid_upload_media'>upload_media</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span>
|
3988
4440
|
<span class='label'>content_type:</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
@@ -4027,8 +4479,7 @@
|
|
4027
4479
|
|
4028
4480
|
</h3><div class="docstring">
|
4029
4481
|
<div class="discussion">
|
4030
|
-
|
4031
|
-
<p>Return the Entity::Account object for the token we’re using.</p>
|
4482
|
+
<p>Return the Entity::Account object for the token we're using.</p>
|
4032
4483
|
|
4033
4484
|
<p>Requires a token (obviously).</p>
|
4034
4485
|
|
@@ -4064,12 +4515,12 @@
|
|
4064
4515
|
<pre class="lines">
|
4065
4516
|
|
4066
4517
|
|
4067
|
-
|
4068
|
-
|
4069
|
-
|
4518
|
+
227
|
4519
|
+
228
|
4520
|
+
229</pre>
|
4070
4521
|
</td>
|
4071
4522
|
<td>
|
4072
|
-
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line
|
4523
|
+
<pre class="code"><span class="info file"># File 'lib/shep/session.rb', line 227</span>
|
4073
4524
|
|
4074
4525
|
<span class='kw'>def</span> <span class='id identifier rubyid_verify_credentials'>verify_credentials</span>
|
4075
4526
|
<span class='kw'>return</span> <span class='id identifier rubyid_rest_get'>rest_get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>accounts/verify_credentials</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="Entity.html" title="Shep::Entity (class)">Entity</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Entity/Account.html" title="Shep::Entity::Account (class)">Account</a></span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
@@ -4084,9 +4535,9 @@
|
|
4084
4535
|
</div>
|
4085
4536
|
|
4086
4537
|
<div id="footer">
|
4087
|
-
Generated on
|
4538
|
+
Generated on Thu Jun 15 10:09:20 2023 by
|
4088
4539
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
4089
|
-
0.9.34 (ruby-3.
|
4540
|
+
0.9.34 (ruby-3.0.3).
|
4090
4541
|
</div>
|
4091
4542
|
|
4092
4543
|
</div>
|