Class: Yt::Annotations::Note
Overview
A Note annotation is just a basic annotation with text, start/end time and an optional link. It’s shaped like a Post-It with a curved corner.
Instance Attribute Summary
Attributes inherited from Base
#ends_at, #link, #starts_at, #text
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ Note
constructor
A new instance of Note.
Constructor Details
#initialize(data = {}) ⇒ Note
Returns a new instance of Note.
10 11 12 13 14 15 |
# File 'lib/yt/annotations/note.rb', line 10 def initialize(data = {}) @text = data['TEXT'] @starts_at = to_seconds regions_of(data)[0]['t'] @ends_at = to_seconds regions_of(data)[1]['t'] @link = to_link data.fetch('action', {})['url'] end |