Module: Dm::Readable
- Included in:
- DailyMotionAccount, DailyMotionResource
- Defined in:
- lib/dm/readable.rb
Overview
Provides methods to read attributes for public objects (accounts, videos..)
Instance Method Summary collapse
-
#description ⇒ Object
Return the description of a DailyMotion object.
-
#id ⇒ Object
Return the unique DailyMotion identifier of a DailyMotion object.
-
#kind ⇒ Object
Return the kind of the DailyMotion object (either ‘channel’ or ‘video’).
-
#thumbnail_url ⇒ Object
Return the URL of the DailyMotion object thumbnail.
-
#title ⇒ Object
Return the title of a DailyMotion object.
Instance Method Details
#description ⇒ Object
Return the description of a DailyMotion object
16 17 18 |
# File 'lib/dm/readable.rb', line 16 def description info[:snippet][:description] end |
#id ⇒ Object
Return the unique DailyMotion identifier of a DailyMotion object
6 7 8 |
# File 'lib/dm/readable.rb', line 6 def id info[:id] end |
#kind ⇒ Object
Return the kind of the DailyMotion object (either ‘channel’ or ‘video’)
26 27 28 |
# File 'lib/dm/readable.rb', line 26 def kind info.fetch(:kind, '').split("#").last end |
#thumbnail_url ⇒ Object
Return the URL of the DailyMotion object thumbnail
21 22 23 |
# File 'lib/dm/readable.rb', line 21 def thumbnail_url info[:snippet][:thumbnails][:default][:url] end |
#title ⇒ Object
Return the title of a DailyMotion object
11 12 13 |
# File 'lib/dm/readable.rb', line 11 def title info[:snippet][:title] end |