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



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

def entity_url
  @entity_url
end

#paramsObject

Returns the value of attribute params

Returns:

  • (Object)

    the current value of params



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

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



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

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)


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

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



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

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