Class: ArticleJSON::Utils::OEmbedResolver::FacebookVideo
- Defined in:
- lib/article_json/utils/o_embed_resolver/facebook_video.rb
Instance Method Summary collapse
-
#access_token ⇒ String
The facebook access token.
-
#name ⇒ String
Human readable name of the resolver.
-
#oembed_url ⇒ String
The URL for the oembed API call.
-
#source_url ⇒ String
The video URL of the element.
Methods inherited from Base
build, #initialize, #oembed_data, resolver_by_embed_type, #unavailable_message
Constructor Details
This class inherits a constructor from ArticleJSON::Utils::OEmbedResolver::Base
Instance Method Details
#access_token ⇒ String
The facebook access token. If not set, it raises an exception explaining how to configure it.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/article_json/utils/o_embed_resolver/facebook_video.rb', line 28 def access_token token = ArticleJSON.configuration.facebook_token if token.nil? raise 'You need to configure the facebook token to use facebook' \ 'embed videos, see:' \ 'https://github.com/Devex/article_json#facebook-oembed' end token end |
#name ⇒ String
Human readable name of the resolver
7 8 9 |
# File 'lib/article_json/utils/o_embed_resolver/facebook_video.rb', line 7 def name 'Facebook video' end |
#oembed_url ⇒ String
The URL for the oembed API call
13 14 15 16 |
# File 'lib/article_json/utils/o_embed_resolver/facebook_video.rb', line 13 def "https://graph.facebook.com/v9.0/oembed_video?url=#{source_url}" \ "&access_token=#{access_token}" end |
#source_url ⇒ String
The video URL of the element
20 21 22 |
# File 'lib/article_json/utils/o_embed_resolver/facebook_video.rb', line 20 def source_url "https://www.facebook.com/facebook/videos/#{@element.}" end |