Class: TwitterJekyll::ApiRequest Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/jekyll-twitter-plugin.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Holds the URI were going to request with any parameters

Constant Summary collapse

TWITTER_API_URL =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

"https://publish.twitter.com/oembed".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#entity_urlObject

Returns the value of attribute entity_url

Returns:

  • (Object)

    the current value of entity_url



109
110
111
# File 'lib/jekyll-twitter-plugin.rb', line 109

def entity_url
  @entity_url
end

#paramsObject

Returns the value of attribute params

Returns:

  • (Object)

    the current value of params



109
110
111
# File 'lib/jekyll-twitter-plugin.rb', line 109

def params
  @params
end

Instance Method Details

#cache_keyObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

A cache key applicable to the current request with params



125
126
127
# File 'lib/jekyll-twitter-plugin.rb', line 125

def cache_key
  Digest::MD5.hexdigest("#{self.class.name}-#{unique_request_key}")
end

#ssl?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Always;

Returns:

  • (Boolean)


113
114
115
# File 'lib/jekyll-twitter-plugin.rb', line 113

def ssl?
  true
end

#to_uriObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return a URI for Twitter API with query params



118
119
120
121
122
# File 'lib/jekyll-twitter-plugin.rb', line 118

def to_uri
  URI.parse(TWITTER_API_URL).tap do |uri|
    uri.query = URI.encode_www_form url_params
  end
end