Module: X::Objects::Lookups::Media
- Included in:
- API
- Defined in:
- x-objects/lib/x/objects/lookups/media.rb
Overview
Look up media by media key
Internal to x-objects: X::Objects::API includes it, and its methods are public API of the client that includes API, but the module is only how they are grouped, and some of them need the methods of another, so include API rather than this module alone.
Instance Method Summary collapse
-
#find_all_media(media, concurrency: BatchFinders::DEFAULT_CONCURRENCY, **params) {|problem| ... } ⇒ Array<X::Media>
Look up media by media key, in parallel batches.
-
#find_media(media_key, **params) {|problem| ... } ⇒ X::Media?
Look up media by media key.
-
#find_media!(media_key, **params) ⇒ X::Media
Look up media by media key, raising if it is not found.
Instance Method Details
#find_all_media(media, concurrency: BatchFinders::DEFAULT_CONCURRENCY, **params) {|problem| ... } ⇒ Array<X::Media>
Look up media by media key, in parallel batches
53 54 55 |
# File 'x-objects/lib/x/objects/lookups/media.rb', line 53 def find_all_media(media, concurrency: BatchFinders::DEFAULT_CONCURRENCY, **params, &) X::Media.find_all(media, client: self, concurrency:, **params, &) end |
#find_media(media_key, **params) {|problem| ... } ⇒ X::Media?
Look up media by media key
A post refers to its media by media key, and so does what an upload returns, so this reads the photo, video, or animated GIF that was uploaded, with its URL and variants.
33 34 35 |
# File 'x-objects/lib/x/objects/lookups/media.rb', line 33 def find_media(media_key, **params, &) X::Media.find(media_key, client: self, **params, &) end |