module Googol::Readable

Provides methods to read attributes for public objects (accounts, videos..)

Public Instance Methods

description() click to toggle source

Return the description of a Youtube object

# File lib/googol/readable.rb, line 16
def description
  info[:snippet][:description]
end
id() click to toggle source

Return the unique Youtube identifier of a Youtube object

# File lib/googol/readable.rb, line 6
def id
  info[:id]
end
kind() click to toggle source

Return the kind of the Youtube object (either ‘channel’ or ‘video’)

# File lib/googol/readable.rb, line 34
def kind
  info.fetch(:kind, '').split("#").last
end
thumbnail_url(size = :default) click to toggle source

Return the URL of the thumbnail image of the Youtube channel/videp.

@option size [Symbol] :default The size of the thumbnail. Valid values are:

:default (channel: 88px x 88px, video: 120px x 90px)
:medium (channel: 240px x 240px, video: 320px x 180px)
:high (channel: 800px x 800px, video: 480px x 360px)

@return [String] The thumbnail URL

# File lib/googol/readable.rb, line 28
def thumbnail_url(size = :default)
  size = :default unless [:medium, :high].include? size
  info[:snippet][:thumbnails][size][:url]
end
title() click to toggle source

Return the title of a Youtube object

# File lib/googol/readable.rb, line 11
def title
  info[:snippet][:title]
end