Class: TwitterJekyll::Oembed

Inherits:
TwitterApi show all
Includes:
Cacheable
Defined in:
lib/jekyll-twitter-plugin.rb

Constant Summary

Constants inherited from TwitterApi

TwitterApi::ERRORS_TO_IGNORE

Instance Attribute Summary

Attributes inherited from TwitterApi

#error

Instance Method Summary collapse

Methods included from Cacheable

#cache_key

Methods inherited from TwitterApi

#initialize

Constructor Details

This class inherits a constructor from TwitterJekyll::TwitterApi

Instance Method Details

#fetchObject



116
117
118
119
120
121
122
123
124
125
126
# File 'lib/jekyll-twitter-plugin.rb', line 116

def fetch
  tweet_id = id_from_status_url(@status_url)

  if tweet = find_tweet(tweet_id)
    # To work around a 'bug' in the Twitter gem modifying our hash we pass in
    # a copy otherwise our cache key is altered.
    @client.oembed tweet, @params.dup
  else
    error
  end
end