Class: Chute::V2::Albums
- Inherits:
-
Object
- Object
- Chute::V2::Albums
- Defined in:
- lib/chute/v2/albums.rb
Class Method Summary collapse
- .add_assets(album_id, *asset_ids) ⇒ Object
-
.all(page = nil, per_page = nil) ⇒ Object
Album Listing.
-
.assets(id, page, per_page) ⇒ Object
Album Assets.
-
.copy_asset(album_id, asset_id, to_album) ⇒ Object
Copy asset from one album to another, carrying over all asset’s metadata.
-
.create(album) ⇒ Object
Album Create.
-
.delete(id) ⇒ Object
Album Delete.
-
.find(id) ⇒ Object
Album Details.
-
.geo_locate(id, lat, lng, radius) ⇒ Object
Album Assets Geo Search.
-
.import(album_id, *urls) ⇒ Object
Import Album Assets.
-
.import_from_instagram(album_id, *ids) ⇒ Object
Import from Instagram Ids.
-
.move_asset(album_id, asset_id, to_album) ⇒ Object
Move asset from one album to another, preserving all asset’s metadata.
- .remove_assets(album_id, *asset_ids) ⇒ Object
- .stats(album_id) ⇒ Object
-
.update(id, album = {}) ⇒ Object
Album Update.
Class Method Details
.add_assets(album_id, *asset_ids) ⇒ Object
54 55 56 |
# File 'lib/chute/v2/albums.rb', line 54 def add_assets(album_id, *asset_ids) Chute::Client.post("/v2/albums/#{album_id}/add_assets", asset_ids: asset_ids) end |
.all(page = nil, per_page = nil) ⇒ Object
Album Listing
6 7 8 |
# File 'lib/chute/v2/albums.rb', line 6 def all(page=nil, per_page=nil) Chute::Client.get("/v2/albums", page: page, per_page: per_page) end |
.assets(id, page, per_page) ⇒ Object
Album Assets
21 22 23 |
# File 'lib/chute/v2/albums.rb', line 21 def assets(id, page, per_page) Chute::Client.get("/v2/albums/#{id}/assets", page: page, per_page: per_page) end |
.copy_asset(album_id, asset_id, to_album) ⇒ Object
Copy asset from one album to another, carrying over all asset’s metadata
68 69 70 |
# File 'lib/chute/v2/albums.rb', line 68 def copy_asset(album_id, asset_id, to_album) Chute::Client.post("/v2/albums/#{album_id}/assets/#{asset_id}/copy/#{to_album}") end |
.create(album) ⇒ Object
Album Create
36 37 38 |
# File 'lib/chute/v2/albums.rb', line 36 def create(album) Chute::Client.post("/v2/albums", album: album) end |
.delete(id) ⇒ Object
Album Delete
46 47 48 |
# File 'lib/chute/v2/albums.rb', line 46 def delete(id) Chute::Client.delete("/v2/albums/#{id}") end |
.find(id) ⇒ Object
Album Details
11 12 13 |
# File 'lib/chute/v2/albums.rb', line 11 def find(id) Chute::Client.get("/v2/albums/#{id}") end |
.geo_locate(id, lat, lng, radius) ⇒ Object
Album Assets Geo Search
16 17 18 |
# File 'lib/chute/v2/albums.rb', line 16 def geo_locate(id, lat, lng, radius) Chute::Client.get("/v2/albums/#{id}/assets/geo/#{lat},#{lng}/#{radius}") end |
.import(album_id, *urls) ⇒ Object
Import Album Assets
26 27 28 |
# File 'lib/chute/v2/albums.rb', line 26 def import(album_id, *urls) Chute::Client.post("/v2/albums/#{album_id}/assets/import", urls: urls) end |
.import_from_instagram(album_id, *ids) ⇒ Object
Import from Instagram Ids
31 32 33 |
# File 'lib/chute/v2/albums.rb', line 31 def import_from_instagram(album_id, *ids) Chute::Client.post("/v2/albums/#{album_id}/assets/import", instagram_ids: ids) end |
.move_asset(album_id, asset_id, to_album) ⇒ Object
Move asset from one album to another, preserving all asset’s metadata
63 64 65 |
# File 'lib/chute/v2/albums.rb', line 63 def move_asset(album_id, asset_id, to_album) Chute::Client.post("/v2/albums/#{album_id}/assets/#{asset_id}/move/#{to_album}") end |
.remove_assets(album_id, *asset_ids) ⇒ Object
58 59 60 |
# File 'lib/chute/v2/albums.rb', line 58 def remove_assets(album_id, *asset_ids) Chute::Client.post("/v2/albums/#{album_id}/remove_assets",asset_ids: asset_ids) end |