Skip to content

Commit

Permalink
Merge pull request #216 from Fullscreen/update_documentation_for_asset
Browse files Browse the repository at this point in the history
Updated README.md to include instructions on retrieving information f…
  • Loading branch information
claudiofullscreen committed Jul 14, 2015
2 parents 9774fa6 + b993d1b commit 79ee8f7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,24 @@ asset.ownership.release! #=> true
asset.update metadata_mine: {notes: 'Some notes'} #=> true
```

* to retrieve metadata for an asset (e.g. title, notes, description, custom_id)

```ruby
content_owner = Yt::ContentOwner.new(...)
asset = content_owner.assets.where(id: 'A969176766549462', fetch_metadata: 'mine').first
asset.metadata_mine.title #=> "Master Final Neu La Anh Fix"

asset = content_owner.assets.where(id: 'A969176766549462', fetch_metadata: 'effective').first
asset.metadata_effective.title #=> "Neu la anh" (different due to ownership conflicts)
```

* to search for an asset

```ruby
content_owner.assets.where(labels: "campaign:cpiuwdz-8oc").size #=> 417
content_owner.assets.where(labels: "campaign:cpiuwdz-8oc").first.title #=> "Whoomp! (Supadupafly) (Xxl Hip House Mix)"
```

Yt::Claim
---------

Expand Down

0 comments on commit 79ee8f7

Please sign in to comment.