class ArticleJSON::Utils::OEmbedResolver::YoutubeVideo

Public Instance Methods

name() click to toggle source

Human readable name of the resolver @return [String]

# File lib/article_json/utils/o_embed_resolver/youtube_video.rb, line 7
def name
  'Youtube video'
end
oembed_url() click to toggle source

The URL for the oembed API call @return [String]

# File lib/article_json/utils/o_embed_resolver/youtube_video.rb, line 13
def oembed_url
  "http://www.youtube.com/oembed?format=json&url=#{source_url}"
end
source_url() click to toggle source

The video URL of the element @return [String]

# File lib/article_json/utils/o_embed_resolver/youtube_video.rb, line 19
def source_url
  "https://www.youtube.com/watch?v=#{@element.embed_id}"
end