Class: Yt::Models::Description
- Inherits:
-
String
- Object
- String
- Yt::Models::Description
- Defined in:
- lib/yt/models/description.rb
Overview
Encapsulates information about the description of a resource, for instance a channel. The value has a maximum length of 1000 characters.
Instance Method Summary collapse
-
#has_link_to_channel?(options = {}) ⇒ Boolean
Whether the description includes a link to a channel.
-
#has_link_to_playlist? ⇒ Boolean
Whether the description includes a link to a playlist.
-
#has_link_to_subscribe?(options = {}) ⇒ Boolean
Whether the description includes a link to subscribe.
-
#has_link_to_video? ⇒ Boolean
Whether the description includes a link to a video.
Instance Method Details
#has_link_to_channel?(options = {}) ⇒ Boolean
add an option to match the link to a specific channel
Returns whether the description includes a link to a channel.
27 28 29 |
# File 'lib/yt/models/description.rb', line 27 def has_link_to_channel?( = {}) links.any?{|link| link.kind == :channel} end |
#has_link_to_playlist? ⇒ Boolean
add an option to match the link to a specific playlist
Returns whether the description includes a link to a playlist.
47 48 49 |
# File 'lib/yt/models/description.rb', line 47 def has_link_to_playlist? links.any?{|link| link.kind == :playlist} end |
#has_link_to_subscribe?(options = {}) ⇒ Boolean
add an option to match the link to subscribe to a specific channel
Returns whether the description includes a link to subscribe.
37 38 39 |
# File 'lib/yt/models/description.rb', line 37 def has_link_to_subscribe?( = {}) links.any?{|link| link.kind == :subscription} end |
#has_link_to_video? ⇒ Boolean
add an option to match the link to a specific video
Returns whether the description includes a link to a video.
17 18 19 |
# File 'lib/yt/models/description.rb', line 17 def has_link_to_video? links.any?{|link| link.kind == :video} end |