Class: ArticleJSON::Utils::OEmbedResolver::Tweet
- Defined in:
- lib/article_json/utils/o_embed_resolver/tweet.rb
Instance Method Summary collapse
-
#name ⇒ String
Human readable name of the resolver.
-
#oembed_url ⇒ String
The URL for the oembed API call.
-
#source_url ⇒ String
The URL of the tweet.
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
#name ⇒ String
Human readable name of the resolver
7 8 9 |
# File 'lib/article_json/utils/o_embed_resolver/tweet.rb', line 7 def name 'Tweet' end |
#oembed_url ⇒ String
The URL for the oembed API call
13 14 15 16 |
# File 'lib/article_json/utils/o_embed_resolver/tweet.rb', line 13 def 'https://api.twitter.com/1/statuses/oembed.json?align=center' \ "&url=#{source_url}" end |
#source_url ⇒ String
The URL of the tweet
20 21 22 23 |
# File 'lib/article_json/utils/o_embed_resolver/tweet.rb', line 20 def source_url handle, tweet_id = @element..split('/', 2) "https://twitter.com/#{handle}/status/#{tweet_id}" end |