class Chute::V2::Tags

Public Class Methods

add_asset_tags(album_id, asset_id, *tags) click to toggle source

Add new tags to existing assets, without replacing the current ones

# File lib/chute/v2/tags.rb, line 17
def add_asset_tags(album_id, asset_id, *tags)
  Chute::Client.post("/v2/albums/#{album_id}/assets/#{asset_id}/tags", tags: process_array(tags))
end
all_asset_tags(album_id, asset_id) click to toggle source

Asset Tags

# File lib/chute/v2/tags.rb, line 7
def all_asset_tags(album_id, asset_id)
  Chute::Client.get("/v2/albums/#{album_id}/assets/#{asset_id}/tags")
end
delete_asset_tags(album_id, asset_id, *tags) click to toggle source

Delete all tags from an asset

# File lib/chute/v2/tags.rb, line 22
def delete_asset_tags(album_id, asset_id, *tags)
  Chute::Client.delete("/v2/albums/#{album_id}/assets/#{asset_id}/tags", tags: process_array(tags))
end
update_asset_tags(album_id, asset_id, *tags) click to toggle source

Change the complete list of tags for an asset inside an album

# File lib/chute/v2/tags.rb, line 12
def update_asset_tags(album_id, asset_id, *tags)
  Chute::Client.put("/v2/albums/#{album_id}/assets/#{asset_id}/tags", tags: process_array(tags))
end

Private Class Methods

process_array(*args) click to toggle source
# File lib/chute/v2/tags.rb, line 28
def process_array(*args)
  args.flatten.uniq
end